This should be the simplest thing in the world to do, but I can't find any information about it.
As a temporary solution, I have resorted to this:
ApplicationUser user = await db.Users.Where(u => u.Email == email).FirstOrDefaultAsync();
But what I originally imagined I could do was something like this:
await ApplicationUser user = userManager.GetUserAsync(email);
I already have access to userManager
in my controller.
ApplicationUser firstUser = await userManager.FindByEmailAsync(email)
ApplicationUser secondUser = await userManager.FindByIdAsync(id)
ApplicationUser thirdUser= await userManager.FindByNameAsync(name)
You can read full article, and get info about all
userManager
methods here