public async Task<ActionResult> Create(UserRoleViewModel userRoleViewModel) { if (!ModelState.IsValid) return View(); var role = new BlogRole(userRoleViewModel.Name) { Description = userRoleViewModel.Description }; // Save the new Description property: var roleresult = await RoleManager.CreateAsync(role); if (roleresult.Succeeded) return RedirectToAction("Index"); ModelState.AddModelError("", roleresult.Errors.First()); return View(); }
public async Task<IdentityResult> CreateRoleAsync(BlogRole blogRole) { var roleresult = await _roleManager.CreateAsync(blogRole); return roleresult; }