As the title suggests, we would like to display a list of users belonging to a specific role in the ASP.NET MVC&Identity environment.
var model = UserManager.Users.Where (???). ToList ();
I think I can use the IsInRole method.
VS2017 C #
SQLServer 2017 Express
Answer # 1
var allusers = UserManager.Users.ToList ();It worked fine with
var model = allusers.Where (u =>UserManager.IsInRole (u.Id, "GoldMember")). ToList ();
return View (model);
Answer # 2
Understand that it is not CORE ...
If you like the following,
(1) View the Role list
(2) Display the role assignment status for each user
You can do it like the following article.
ASP.NET Identity Role Management (MVC)
- php - display data only for currently logged in users
- ruby - i want to display only "liked" images of all users with rails
- aspnet - i want to display loading while the page is loading
- Implementation of AspNet Core Identity privacy data protection
- aspnet - [aspet core] display images with absolute path
- aspnet - i don't know how to display the data source window
- php - want to display child category articles belonging to a specific parent category on the article list page with wordpress
- i want to display on the screen the login user name or login status after performing cookie authentication with aspnet core
- aspnet mvc framework - aspnet mvc: i want to get information of users who are not logged in by linking with azure active directo
- ruby on rails 5 - i want to display the user's profile image on the post list screen
- c # - aspnet identity user information cannot be obtained from web api
- i want to display users with the linux command history
- c # aspnet mvc image display directory
- css - display the list of users registered in the group
- php - tweet display of users who are following with users who are logged in by joining laravel tables
- python - i want to display the my page button only to users who have logged in with django, but there is a problem
- google apps script - [gas] display the user's displayname
- about record manipulation and display in aspnet core mvc
- php - in wordpress, i want to display a list of child terms belonging to the archive page of the parent term with an image field
- c # - systeminvalidoperationexception occurs when trying to pass model to view
- c# - about aspnet mvc web application and mysql integration
- model value cannot be passed to action method as an argument during aspnet mvc post
- c # - error in aspnet globalasax?
- i'm having trouble creating a function for the email service for account confirmation with aspnet identity (c#)
- aspnet - the systeminvalidcastexception error cannot be resolved
- aspnet - systemnullreferenceexception error occurs during file upload
- aspnet - i'm not sure why "addobject is not a member of "
- c# - how to get the value of another dll's config file from an aspnet mvc project
- aspnet - pathgetfilename cannot be used