示例#1
0
        public ActionResult UserRoles(SelectUserRolesViewModel model)
        {

            ApplicationUser user = _accountService.GetUserById(model.Id);
            _accountService.ClearUserRoles(user.Id);
            model.Roles
                .Where(x => x.Selected)
                .ForEach(item => _accountService.AddUserToRole(user.Id, item.RoleName));
            return RedirectToAction("index");

            // return View(model);
        }
示例#2
0
 public ActionResult UserRoles(string id)
 {
     ApplicationUser user = _accountService.GetUserById(id);
     var model = new SelectUserRolesViewModel(user);
     return View(model);
 }