public ActionResult Delete(SkillAdministrationModel model) { this.Database.Skills.Delete(model.Id); this.Database.SaveChanges(); return RedirectToAction("EditSkills"); }
public ActionResult Edit(SkillAdministrationModel model) { if (ModelState.IsValid) { var dbSkill = this.Database.Skills.GetById(model.Id); dbSkill.Name = model.Name; this.Database.SaveChanges(); } return RedirectToAction("EditSkills"); }
public ActionResult Create(SkillAdministrationModel model) { if (ModelState.IsValid) { Skill dbSkill = new Skill { Name = model.Name }; this.Database.Skills.Add(dbSkill); this.Database.SaveChanges(); } return RedirectToAction("EditSkills"); }