public async Task <IActionResult> Edit(int id, [Bind("ID,Make,Model,Year,VIN,Colour,DealershipID")] Car car) { if (id != car.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(car); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarExists(car.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(car)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,UserName,Email,Company,Position,BirthDate")] 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(int id, [Bind("ID,Name,Email,PhoneNumber")] Dealership dealership) { if (id != dealership.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dealership); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DealershipExists(dealership.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dealership)); }