public async Task<ActionResult> UserRoles(SelectUserRolesViewModel model)
        {
            if (ModelState.IsValid)
            {
                var identityManager = new IdentityManager();
                var user = this.ApplicationDbContext.Users.First(u => u.UserName == model.UserName);
                
                await identityManager.ClearUserRolesAsync(user.Id);

                foreach (var role in model.Roles)
                {
                    if (role.Selected)
                    {
                        await identityManager.AddUserToRoleAsync(user.Id, role.RoleName);
                    }
                }
                return RedirectToAction("index");
            }
            return View();
        }
 public ActionResult UserRoles(string name)
 {
     var user = this.ApplicationDbContext.Users.First(u => u.UserName == name);
     var model = new SelectUserRolesViewModel(user);
     return View(model);
 }