How to use non-thread-safe async/await APIs and patterns with ASP.NET Web API?
This question has been triggered by EF Data Context – Async/Await & Multithreading. I’ve answered that one, but haven’t provided any ultimate solution.
This question has been triggered by EF Data Context – Async/Await & Multithreading. I’ve answered that one, but haven’t provided any ultimate solution.
Is there any performance benefit in using Task.Run in an async Web API Controller for cpu-bound operations?
When a user loads a page, it makes one or more ajax requests, which hit ASP.NET Web API 2 controllers. If the user navigates to another page, before these ajax requests complete, the requests are canceled by the browser. Our ELMAH HttpModule then logs two errors for each canceled request:
I have the following test WebAPI code, I don’t use WebAPI in production but I made this because of a discussion I had on this question: WebAPI Async question
I am trying to understand why an async void method in an ASP.Net application can result in the following exception, while it appears that async Task will not:
I generated a proxy with task-based operations.
Trying to use new C# 5 async model it was surprising to me AspNetSynchronizationContext is an internal class (as well as AspNetSynchronizationContextBase base). Thus undocumented. But it’s essential to know what it does when utilizing async/await feature within your ASP.NET code. Am I correct that
It does guarantee your continuations will get the same HttpContext.Current as original callers?
It does not guarantee the continuations will execute on the same thread as the callers?
I am trying to understand why and when should I use an async controller action. Eventually, when I use await in it, it will wait for the operation to complete in order to return the View.
I have an async method:
There are some articles which indicate that async database calls are bad idea in .NET.