ASP.Net MVC List of User and their Roles

Viewed 3902

I'm using ASP.NET MVC Default project. In there we have a database called AspNetRoles (defines roles like Admin, User)
Role Database

then there's a database called AspNetUsers which just defines Users when you register them User Database

and the last and most important is AspNetUserRoles. When you assign Roles to the User here is where it is placed (and the Id's are hashed)

UserRole Database

My question is, how do I get a list of every user on the system and their roles? I can't figure out how to start doing this. Should I create my own User and Role database and forget about the default one? Or is there a way of creating with the default ones?


Also, I would keep in mind that as of now I'm assigning Roles when registering (User by default) and later when I create the Index where I show the list of Users and Roles, I will want to edit them, but this is just a disclaimer. Thank you very much for any type of help.

3 Answers
Related