public async Task AddRole(RolesAllViewModel model) { if (!await this.roleManager.RoleExistsAsync(model.Name)) { await this.roleManager.CreateAsync(new IdentityRole { Name = model.Name, NormalizedName = model.Name.ToUpper(), ConcurrencyStamp = Guid.NewGuid().ToString(), }); } }
public async Task <IActionResult> CreateRole(RolesAllViewModel model) { await this.userService.AddRole(model); return(this.RedirectToAction("AllRoles")); }