-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MVC5: Asynchronous child actions Not supported #61
Comments
Unfortunately I'm not aware of any good/clean way to do this. It's a limitation of how Child Actions are implemented in MVC, which I don't think there's a good way to work around. |
Using SynchronizationContext
Using Task Library
To use this approach - just call your async method inline...
|
Dude, best timing for an answer here. Had this issue just yesterday. Thanks @alohaninja ! |
I think there's a typo in the first approach. Should it be |
Corrected - nice catch! 🎉 |
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?
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
The text was updated successfully, but these errors were encountered: