Get role/s of current logged in user in ASP.NET Core MVC
问题 How can I get the logged in user's role/s in ASP.NET Core MVC? I want to get role details as soon as user logs in into the application, but by using following code I am not able to retrieve the role details public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; if (ModelState.IsValid) { var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false); if (result