Пример #1
0
        //Get by ID
        public HttpResponseMessage GetCliente(int id)
        {
            Cliente cliente = db.GetCliente(id);

            if (cliente == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, "No hay registros con ID " + id));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, cliente));
        }
        public async Task <IActionResult> GetCliente([FromRoute] int code, int seleccion)
        {
            var result = await Task.Run(() => context.GetCliente(code, seleccion));

            if (result == null)
            {
                return(NotFound("Cliente not Found"));
            }

            return(Ok(result));
        }
Пример #3
0
        public ClienteResponse Consultar(int clientId)
        {
            var item = _repository.GetCliente(clientId);

            return(new ClienteResponse(item.Result));
        }