Exemplo n.º 1
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await _airportService.DeleteAsync(id);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var airportDTO = _mapper.Map <Airport, AirportDTO>(result.Airport);

            return(Ok(airportDTO));
        }
 public async Task <ActionResult <bool> > Delete(string key)
 {
     try
     {
         return(Ok(new Notification
         {
             Success = true,
             Data = await _airportService.DeleteAsync(key)
         }));
     }
     catch (Exception ex)
     {
         return(BadRequest(new Notification
         {
             Success = false,
             Errors = ex.Message
         }));
     }
 }