Using this answer, I implemented below code to get list of ApplicationUsers
in a specific role.
I need to mention that ApplicationUser is an extention of IdentityUser. I want to know are there any better methods for this?
ApplicationDbContext context = new ApplicationDbContext();
var store = new Microsoft.AspNet.Identity.EntityFramework.UserStore<ApplicationUser>(dbContext);
var manager = new Microsoft.AspNet.Identity.UserManager<ApplicationUser>(store);
List<ApplicationUser> users = new List<ApplicationUser>();
foreach (ApplicationUser user in manager.Users.ToList())
{
if (manager.IsInRole(user.Id,"Admin")){
users.Add(user);
}
}