public ActionResult Edit(int Id, Trainer trainer) { var res = db.Trainers.Find(Id); if (res != null) { res.Id = trainer.Id; res.Name = trainer.Name; res.TrainingId = trainer.TrainingId; db.SaveChanges(); return(RedirectToAction("Index")); } else { return(View()); } }
public void Save() { _dbContext.SaveChanges(); }