Esempio n. 1
0
        public async Task <IActionResult> Get(int id)
        {
            var client = await _clientsService.GetById(id);

            if (client == null)
            {
                return(NotFound());
            }

            return(Ok(client));
        }
Esempio n. 2
0
        public Policies GetById(string id)
        {
            var policie = Mapper(_mockyConnectorService.GetByKey(urlMocky, JsonModels.policies, "id", id));

            if (policie != null)
            {
                policie.Client = _clientsService.GetById(policie.Client.Id);
            }

            return(policie);
        }
Esempio n. 3
0
        public IHttpActionResult Get(string id)
        {
            try
            {
                ClientsDto client = clientsService.GetById(id);

                if (client != null)
                {
                    return(Ok(client));
                }
                else
                {
                    return(NotFound());
                }
            }
            catch (VuelingExceptions ex)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }
        }
Esempio n. 4
0
        public IHttpActionResult Get(string id)
        {
            try
            {
                ClientsDto client = clientsService.GetById(id);

                if (client != null)
                {
                    return(Ok(client));
                }
                else
                {
                    throw new HttpResponseException(HttpStatusCode.BadRequest);
                }
            }
            catch (VuelingExceptions ex)
            {
                throw new VuelingExceptions("No se han podido obtener los clientes.", ex);
            }
        }
 public ClientViewModel Get(int id)
 {
     return(_mapper.Map <ClientDTO, ClientViewModel>(_clientsService.GetById(id)));;
 }