I have created simple async controllers that call into async methods that then call PostAsync on the HttpClient to retrieve various REST service endpoints. All works well, but how can I test to insure that the controller is really calling a background thread and releasing the primary thread back to the pool? I want to insure that I do have all the async sweetness working correctly and that I am not inadvertently running synchronous methods despite all my work to make everything async.
I have created simple async controllers that call into async methods that then call
Share
I found that
System.Threading.Thread.CurrentThread.IsThreadPoolThreadwill provide whether the current thread is still a threadpool thread or not.