Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created February 7, 2017 23:06
Show Gist options
  • Save gavilanch/278d952077a1466fcbcf61a8ce601427 to your computer and use it in GitHub Desktop.
Save gavilanch/278d952077a1466fcbcf61a8ce601427 to your computer and use it in GitHub Desktop.
using (ApplicationDbContext db = new ApplicationDbContext())
{
var rm = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(db));
var roleId = rm.FindByName("NombreDeLRol").Name;
var usuarios = db.Users.Where(x => x.Roles.Any(y => y.RoleId == roleId)).ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment