Example #1
0
        public async Task <IEnumerable <AirportDTO> > GetAllAsync()
        {
            var airports = await _airportService.ListAsync();

            var dtos = _mapper.Map <IEnumerable <Airport>, IEnumerable <AirportDTO> >(airports);

            return(dtos);
        }
 public async Task <IEnumerable <Airport> > ListAsync([FromBody] ListViewModel module)
 {
     if (module.PageIndex <= 0)
     {
         module.PageIndex = 1;
     }
     if (module.PageSize <= 0)
     {
         module.PageSize = 10;
     }
     if (module.Sort != "id" && module.Sort != "id_desc")
     {
         module.Sort = null;
     }
     return(await _airportService.ListAsync(module.PageSize, module.PageIndex, module.Sort, module.Filter));
 }