示例#1
0
        public void DeleteFlightTest()
        {
            FlightRepository.Delete(new Flight(id));
            Entity flight = FlightRepository.Find(id);

            Assert.That(flight, Is.Null);
        }
示例#2
0
        internal Flight Delete(int id)
        {
            Flight original = Get(id);

            _repo.Delete(id);
            return(original);
        }
示例#3
0
        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"));
        }
示例#5
0
        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);
            }
        }
示例#6
0
 public ActionResult Delete(int id)
 {
     Repository.Delete(id);
     return(RedirectToAction("Index", "Flight"));
 }