Пример #1
0
 public IActionResult DeleteConfirmed(int id)
 {
     var myLocation = db.Locations.FirstOrDefault(locations => locations.LocationId == id);
     db.Remove(myLocation);
     db.SaveChanges();
     return RedirectToAction("Index");
 }
Пример #2
0
        public IActionResult DeleteConfirmed(int id)
        {
            var myPerson = db.People.FirstOrDefault(People => People.PersonId == id);

            db.Remove(myPerson);
            db.SaveChanges();
            return(RedirectToAction("Index", "Location"));
        }
Пример #3
0
        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 }));
        }
Пример #4
0
 public void Remove(Location location)
 {
     db.Remove(location);
     db.SaveChanges();
 }