예제 #1
0
        public async Task EditAirport(AirPortBE airport, CancellationToken token)
        {
            var existingAirport = await _flightplanner_entities.Airport.Where(x => x.Id == airport.Id).FirstOrDefaultAsync();

            if (existingAirport != null)
            {
                AirPortMap.Map(airport, existingAirport);
                await Save(token);
            }
        }
예제 #2
0
 public async Task AddAirport(AirPortBE airport, CancellationToken token)
 {
     _flightplanner_entities.Airport.Add(AirPortMap.Map(airport));
     await Save(token);
 }
예제 #3
0
        public async Task <AirPortBE> GetAirportById(int idAirport)
        {
            var airport = await _flightplanner_entities.Airport.Where(x => x.Id == idAirport).FirstOrDefaultAsync();

            return(AirPortMap.Map(airport));
        }
예제 #4
0
        public async Task <AirPortBE> GetAirportByCode(string codeAirport)
        {
            var airport = await _flightplanner_entities.Airport.Where(x => x.Code == codeAirport).FirstOrDefaultAsync();

            return(AirPortMap.Map(airport));
        }
예제 #5
0
        public async Task <List <AirPortBE> > GetAirports()
        {
            var airports = await _flightplanner_entities.Airport.ToListAsync();

            return(AirPortMap.Map(airports));
        }