You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
With regard to the preferred use of async methods, I tried out if it will work for both filters, BExISApiAuthorizeAttribute.cs and BExISAuthorizeAttribute.cs to perform the call "OnAuthorization" asynchronously. At the first sight, it seemed to work, but soon first issues came up. At the end, within MVC (regardless if MVC4 or MVC5) it is not possible and furthermore not a good idea to perform such calls in an asynchronous manner.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
With regard to the preferred use of async methods, I tried out if it will work for both filters, BExISApiAuthorizeAttribute.cs and BExISAuthorizeAttribute.cs to perform the call "OnAuthorization" asynchronously. At the first sight, it seemed to work, but soon first issues came up. At the end, within MVC (regardless if MVC4 or MVC5) it is not possible and furthermore not a good idea to perform such calls in an asynchronous manner.
Sources:
Can we make async method call from MVC filter?
Conclusion
Even after small refactoring of the existing attributes and authorize calls, we will stick to synchronous execution.
Beta Was this translation helpful? Give feedback.
All reactions