Is it possible to await on tasks in Razor .cshtml views?
await
By default it complains that it can only be used in methods marked with async so I
async
Following on MaxP's answer, it's easy to return a value from that code, despite Knagis comment:
@{ int x = DoAsyncStuffWrapper().Result; } @functions { async TaskDoAsyncStuffWrapper() { await DoAsyncStuff(); } }