public async Task <IActionResult> Get(int id) { var client = await _clientsService.GetById(id); if (client == null) { return(NotFound()); } return(Ok(client)); }
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); }
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); } }
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)));; }