//[AutFilter] public ActionResult Delete(int id, bool?savechangesError = false) { if (savechangesError.GetValueOrDefault()) { ViewBag.ErrorMessage = "Silme işlemi başarısız."; } Arac secilenId = ar.SelectById(id); ar.Delete(id); return(RedirectToAction("List", secilenId)); }
public void Delete(int id) { using (AracRepository aracRepo = new AracRepository()) { try { aracRepo.Delete(id); } catch (Exception ex) { throw new Exception(ex.Message); } } }