Net Identity
I have a request where I need to return an IdentityUser + its role name.
I have a class that inherits from IdentityUser and add an extra property call "UserRole".
public class ApplicationUser : IdentityUser {
public string? UserRole { get; set; }
}
So when I run this line, I will have the message "Invalid column name 'UserRole'."
And this happen because I dont have this UserRole column in my AspNetUsers table, and I can't have it in there.
IEnumerable<ApplicationUser> users = _userManager.Users.Where(u => u.companyId==123);
foreach (var user in users)
{
user.UserRole = await _userManager.GetRolesAsync(user);
}
Any help ?
Thx