Esempio n. 1
0
        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());
            }
        }
Esempio n. 2
0
 public void Save()
 {
     _dbContext.SaveChanges();
 }