public IActionResult Edit(int id, [Bind("Id,Name,Phone,Email,Address,LinkedinProfile")] Trainer trainer) { if (id != trainer.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _iTrainerManager.Update(trainer); } catch (DbUpdateConcurrencyException) { if (!TrainerExists(trainer.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(trainer)); }
public IActionResult Edit(long id, Trainer trainer) { if (id != trainer.Id) { return(NotFound()); } if (ModelState.IsValid) { try { trainer.UpdatedAt = DateTime.Now; _iTrainerManager.Update(trainer); } catch (DbUpdateConcurrencyException) { if (!TrainerExists(trainer.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(trainer)); }