// GET: api/Clients public IHttpActionResult Get() { try { List <ClientsDto> listaClients = clientsService.GetAll(); if (listaClients != null) { return(Ok(listaClients)); } else { return(NotFound()); } } catch (VuelingExceptions ex) { throw new HttpResponseException(HttpStatusCode.BadRequest); } }
public IHttpActionResult Get() { try { List <ClientsDto> listaClients = clientsService.GetAll(); if (listaClients != null) { return(Ok(listaClients)); } else { throw new HttpResponseException(HttpStatusCode.BadRequest); } } catch (VuelingExceptions ex) { throw new VuelingExceptions("No se han podido obtener los clientes.", ex); } }
public async Task <IActionResult> Get() { var clients = await _clientsService.GetAll(); return(Ok(clients)); }
public IEnumerable <ClientViewModel> Get() { return(_mapper.Map <IEnumerable <ClientDTO>, IEnumerable <ClientViewModel> >(_clientsService.GetAll()));; }