public void DeleteFlightTest() { FlightRepository.Delete(new Flight(id)); Entity flight = FlightRepository.Find(id); Assert.That(flight, Is.Null); }
internal Flight Delete(int id) { Flight original = Get(id); _repo.Delete(id); return(original); }
internal Flight Delete(int id) { Flight Flight = Get(id); _repo.Delete(Flight); return(Flight); }
public IActionResult Delete(ShowFlightModel model, string returnUrtl = null) { var flight = new FlightModel { Id = model.Id, }; _flights.Delete(flight); return(RedirectToAction("Index")); }
public void DeleteFlight() { FlightRepository repository; using (repository = new FlightRepository()) { Flight flight = repository.FindBy(f => f.FlightNumber == "BY004").Single(); repository.Delete(flight); repository.Save(); } using (repository = new FlightRepository()) { Flight flight = repository.FindBy(f => f.FlightNumber == "BY004").FirstOrDefault(); Assert.IsNull(flight); } }
public ActionResult Delete(int id) { Repository.Delete(id); return(RedirectToAction("Index", "Flight")); }