Closed
Description
what is the recommended way to execute asynchronous actions (database access) through child actions in MVC5? I understand its very subjective to what i do in the child action. In my case, its only async queries to sql server using EF6.
Is wrapping in a task.run has any side effects in this case or is there any better way microsoft recommends other than changing to Synchronous?
@Html.Action("SampleChildAction)
public PartialViewResult SampleChildAction()
{
Task.Run(async () => { await asyncMethod(); }).Result;
return PartialView("_SampleChildActionView");
}
I couldn't locate anything guidance from microsoft. I would appreciate any help.
https://justsimplycode.com/2016/09/04/child-action-in-mvc-5-does-not-support-async/
dotnet/aspnetcore#343
Metadata
Metadata
Assignees
Labels
No labels