Most Web API 2.0 methods I\'ve seen return IHttpActionResult
, which is defined as an interface that \"defines a command that asynchronously creates a System.Net.Htt
The difference between using IHttpActionResult
and async Task
is whether any of your code utilizes the async
and await
feature. Many libraries like Entity Framework provide async
versions of methods (e.g. SaveChangesAsync
) that provide a slight performance increase. However, there are pitfalls to using async
with Web API, so unless you understand many of the idiosyncrasies it is prudent to stick to the synchronous API.
Steven Cleary has a lot of information on his blog about the idiosyncrasies of async
and await
. To get started I advise looking at Don't block on async code.