When I use the given code it shows the warning always coming 'async method lacks 'await' operators and will run synchronously' when I run the application. How can I solve
[HttpGet]
public async Task<IActionResult> CreateAuthor()
{
return View();
}
When I use the given code it shows the warning always coming 'async method lacks 'await' operators and will run synchronously' when I run the application. How can I solve
Seriously? There's not code in the Action method. What code do you expect to run asynchronous?
Perhaps try learning async/await as it seems you are guessing how the pattern works.
Member
410 Points
1326 Posts
How to solve async method lacks 'await' operators and will run synchronously
May 16, 2020 07:06 AM|polachan|LINK
When I use the given code it shows the warning always coming 'async method lacks 'await' operators and will run synchronously' when I run the application. How can I solve
All-Star
53001 Points
23596 Posts
Re: How to solve async method lacks 'await' operators and will run synchronously
May 16, 2020 11:13 AM|mgebhard|LINK
Seriously? There's not code in the Action method. What code do you expect to run asynchronous?
Perhaps try learning async/await as it seems you are guessing how the pattern works.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/
All-Star
58174 Points
15647 Posts
Re: How to solve async method lacks 'await' operators and will run synchronously
May 16, 2020 03:47 PM|bruce (sqlwork.com)|LINK
Convert to sync