Search code examples
c#asp.netasp.net-mvc-5asp.net-identity

ASP.NET Identity: get all users in a role


How to obtain a list of all users in a role? Before it was possible with Roles.GetUsersInRole, but with new Identity I can't find anything like this.


Solution

  • Its not possible via the RoleManager in 1.0 RTM, in 1.1 it will exposed via an IQueryable RoleManager.Roles. For 1.0, you need to drop down to the implementation layer (i.e. db context)