public async Task<IdentityResult> CreateRoleAsync() { var context = new ApplicationDbContext(); var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context)); return await roleManager.CreateAsync(new IdentityRole()); }
public async Task<IdentityRole> GetByNameAsync(string role) { var context = new ApplicationDbContext(); var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context)); return await roleManager.FindByNameAsync(role); }