Accessing UserManager outside AccountController
If you’re using the default project template, the UserManager gets created the following way: In the Startup.Auth.cs file, there’s a line like this: app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); that makes OWIN pipeline instantiate an instance of ApplicationUserManager each time a request arrives at the server. You can get that instance from OWIN pipeline using the following code inside a … Read more