Inject ApplicationUser in ASP.NET Core MVC
问题 I have a class that requires ApplicationUser (from ASP.NET Identity). The instance should be the current user. public class SomeClass { public SomeClass(ApplicationUser user) { Currently, what I'm doing is I inject the current user from the Controller: var currentUser = await _userManager.GetUserAsync(User); var instance = new SomeClass(currentUser); Now I want to use Dependency Injection provided by Microsoft. I can't figure out how am I going to add ApplicationUser to the services. It