TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Olivier Muhring
NA
150
10.5k
Acquiring all roles an authenticated user has in
Sep 7 2020 10:51 AM
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
<header>
@{
if
(User.Identity.IsAuthenticated)
{
UserManager<IdentityUser> userManager =
new
UserManager<User>();
var rolesArray = userManager.GetRolesAsync(User.Identity.??);
}
}
</header>
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
Reply
Answers (
0
)
System.InvalidOperationException: 'There is no ViewData item of type '
integrate apple pay in web.