示例#1
0
        // 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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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()));;
 }