// GET: Users/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var user = await _context.User.FindAsync(id); if (user == null) { return(NotFound()); } var uvm = new UserViewModel(); BindObject.CopyModel(uvm, user); uvm.Permissions = rbac.GetUserPermissions(user); uvm.Roles = rbac.GetUserRoles(user); uvm.ConfirmPassword = user.Password; Form form = Form(); form.Model(uvm, "ID"); ViewData["formHtml"] = form.GetContent(); ViewData["script"] = form.GetScript(); return(View()); }