public IActionResult DeleteCalendar(Calendar calendar) { try { dbContext.Remove(calendar); dbContext.SaveChanges(); return(RedirectToAction("IndexCalendar")); } catch { return(Redirect("~/Shared/Error")); } }
public ActionResult RemovePet(Pet Pet) { try { dbContext.Remove(Pet); dbContext.SaveChanges(); return(RedirectToAction("PetIndex")); } catch { return(View("PetIndex")); } }