I have a Web API Controller with the following method inside:
public string Tester()
{
Thread.Sleep(2000);
return \"OK\";
}
When I
Look at this question, which is relative to your problem: Are all the web requests executed in parallel and handled asynchronously?
It states that:
A webApi service, by default, executes all its incoming requests in parallel, but only if the current multiple requests (at a certain time) came from different sessions. That is to say, if single client will send some simultaneously requests to server, all of them will be executed sequentially and won't be executed concurrently.
To solve this, you can use async methods, as described here.
Generally, you need to declare your method as async, like this:
public async Task GetObj()