public void DeleteAirport(int id) { Airport airport = _airportRepository.GetById(id); List <AirportScheme> schemes = _airportSchemeRepository.GetMany(a => a.Airport.Id == airport.Id).ToList(); foreach (AirportScheme scheme in schemes) { _airportSchemeRepository.Delete(scheme); } _airportRepository.Delete(_airportRepository.GetById(id)); SaveAirport(); }
public void DeleteAirportScheme(int id) { _airportSchemeRepository.Delete(_airportSchemeRepository.GetById(id)); SaveAirportScheme(); }