public ViewResult AddUserToRole() { var model = new UserRoleViewModel(); PopulateAddNewRoleDropdown(); return View(model); }
public async Task<ViewResult> AddUserToRole(UserRoleViewModel model) { PopulateAddNewRoleDropdown(); if (ModelState.IsValid) { var userManger = HttpContext.GetOwinContext().Get<ApplicationUserManager>(); var result = await userManger.AddToRoleAsync(model.SelectUser, model.SelectRole); if (result.Succeeded) { } } return View(model); }