I'm trying to load an authenticated user's roles, since I need the data in every page I thought it best to add the code in _Layout.cshtml.
- @using Microsoft.AspNetCore.Identity
- @{
- if (User.Identity.IsAuthenticated)
- {
- UserManager
userManager = new UserManager (); - var rolesArray = userManager.GetRolesAsync(User.Identity.??);
- }
- }
But I can't seem to find out how exactly I can do that in the given context.
Can anyone here help?
PS: This might not be the best solution, but since I'm rather new @ this I would like to continue in this direction for the time being

Replies
Know the answer? Post it — somebody with the same question will find it here.