Пример #1
0
        public async Task <IActionResult> ClienteById(int id)
        {
            var Cliente = await _IClienteServices.Get(id);

            if (Cliente == null)
            {
                return(BadRequest("Cliente no existe"));
            }
            return(Ok(Cliente));
        }
Пример #2
0
        public async Task <ActionResult> Get(Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try {
                return(Ok(await _service.Get(id)));
            } catch (ArgumentException e) {
                return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
            }
        }