Curious thing:
Here such request fulfills without errors:
IdentityUserRole userRole = user.Roles.Single(r => r.UserId == user.Id); IdentityRole role = roleManager.Roles.Single(r => r.Id == userRole.RoleId); But if I combine it into one, then the server crashes:
IdentityRole role = roleManager.Roles.Single(r => r.Id == user.Roles.Single(ur => ur.UserId == user.Id).RoleId); Why it happens? Maybe somehow you can safely fix the second request or there is not much difference? For some reason it seems to me that one request is always more rational to use than two ...