public async Task <IActionResult> Edit(string id, [Bind("Major,ID,FirstName,LastName,Email,Phone")] Member member) { if (id != member.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(member); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MemberExists(member.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(member)); }
public async Task <IActionResult> Edit(string id, [Bind("ID,ProjectName,ProjectDescription")] 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)); }