Example #1
0
        public IActionResult DeleteCalendar(Calendar calendar)
        {
            try
            {
                dbContext.Remove(calendar);
                dbContext.SaveChanges();

                return(RedirectToAction("IndexCalendar"));
            }
            catch
            {
                return(Redirect("~/Shared/Error"));
            }
        }
Example #2
0
        public ActionResult RemovePet(Pet Pet)
        {
            try
            {
                dbContext.Remove(Pet);
                dbContext.SaveChanges();

                return(RedirectToAction("PetIndex"));
            }
            catch
            {
                return(View("PetIndex"));
            }
        }