Пример #1
0
 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(),
         });
     }
 }
Пример #2
0
        public async Task <IActionResult> CreateRole(RolesAllViewModel model)
        {
            await this.userService.AddRole(model);

            return(this.RedirectToAction("AllRoles"));
        }