public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Awesomeness")] MadSkill madSkill) { if (id != madSkill.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(madSkill); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MadSkillExists(madSkill.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(madSkill)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,UserRole,FirstName,MiddleName,LastName,Gender,Age")] User user) { if (id != user.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name")] Company company) { if (id != company.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(company); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyExists(company.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,StartDate,EndDate")] Project project) { if (id != project.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(project); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectExists(project.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(project)); }