Friday, June 10, 2016

async/await at Actions

If you want to await in an Action, but you don't want to use .Result which can lead to deadlocks you need to craft the signature of your MVC Action like so:

public async Task<ActionResult> Whatever(Foo foo)

 
 

...in lieu of just:

public ActionResult Whatever(Foo foo)

No comments:

Post a Comment