Created
October 18, 2019 17:41
-
-
Save hd9/b6a627797439b26e0dbc01f9f28cbcf7 to your computer and use it in GitHub Desktop.
Accessing Entity Framework context on the background on .NET Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 2 - Pass it to your background thread | |
// Source: https://blog.hildenco.com/2018/12/accessing-entity-framework-context-on.html | |
public async Task<IActionResult> TestAsyncCall(string id) | |
{ | |
Task.Run(() => BgTask(id, serviceScopeFactory)); | |
return Ok("Thanks, your code will be executed!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment