public IActionResult DeleteConfirmed(int id) { var myLocation = db.Locations.FirstOrDefault(locations => locations.LocationId == id); db.Remove(myLocation); db.SaveChanges(); return RedirectToAction("Index"); }
public IActionResult DeleteConfirmed(int id) { var myPerson = db.People.FirstOrDefault(People => People.PersonId == id); db.Remove(myPerson); db.SaveChanges(); return(RedirectToAction("Index", "Location")); }
public IActionResult DeleteConfirmed(int id) { var myExperience = db.Experiences.FirstOrDefault(experiences => experiences.ExperienceId == id); db.Remove(myExperience); db.SaveChanges(); return(RedirectToAction("Details", "Location", new { id = myExperience.LocationId })); }
public void Remove(Location location) { db.Remove(location); db.SaveChanges(); }