public void Delete(int id) { CaseModeModel model = this._context.CaseMode.Where(x => x.Id == id).FirstOrDefault(); this._context.CaseMode.Remove(model); this._context.SaveChanges(); }
public IActionResult Create(CaseModeModel model) { if (!ModelState.IsValid) { return(View()); } this._caseModeRepository.Save(model); return(RedirectToAction("Index")); }
public IActionResult Update(CaseModeModel model) { var id = model.Id; if (!ModelState.IsValid) { return(View(model)); } this._caseModeRepository.Update(model); return(RedirectToAction("Index")); }
public void Update(CaseModeModel model) { this._context.CaseMode.Update(model); this._context.SaveChanges(); }
public void Save(CaseModeModel model) { this._context.CaseMode.Add(model); this._context.SaveChanges(); }