Why does the Identity mvc template ultilize async in controllers?

Asked

Viewed 30 times

0

When creating a template ASP NET MVC 5 with Identity for example the Login method uses async not to lock the main thread.

I did not understand what is the need to do this being that after the user click login on (login screen) view he will not have to wait anyway the server response in the same (login screen) view to know if the login was accepted or not?

In that case, does it make a difference to have this method with async or without async? This only makes sense to me if one user’s login affects another user’s login on another machine, another address. It affects another user’s login if it has no async?

I’m sorry if the question is too complicated but that’s what I don’t understand :/

Thank you.

  • I think you already have an answer for that here on the site, I just have no way to search now.

  • Thanks for the comment, I did not understand for example in the Login method that uses the "async" what is the need to use it (async) and that the user needs to wait anyway the return of this method to access the system? if in that case he has to wait, it doesn’t matter if it’s asynchronous or not?

  • Linked posts answer your question. Basically, it has nothing to do with the user waiting or not returning, it’s something quite different from that.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.