I've just a question that came to my mind since I've started working on an existing project: Consider the following snippet of code
public async Task<IHttpActionResult> DoSomething(Guid token)
{
var data= await repository.GetDataAsync(token);
return await Task.FromResult(Ok(data));
}
As far I've seen when using await I can just have return Ok(data)
But I've been told that not using that Task.FromResult
would lead to async problems... where can I find more info on this point? It's used in Web API Full Framework (not.NET Core)