Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task<ActionResult> Index()
- {
- await Task.Run(() => do some stuff);
- // Will schedule continuation on the synchronization context causing deadlock in ASP for .NET Framework,
- // but is legit in project type like console app or tests because synchronization context doesn't exist there.
- await Task.Run(() => do some stuff).ConfigureAwait(false); \
- // This is ok in all of the above cases. It will schedule continuation on a thread pool thread.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement