示例#1
0
        public async Task <IActionResult> GetInfo(int id)
        {
            if (id <= 0)
            {
                return(BadRequest("You must specify the id."));
            }

            try
            {
                var entidad = await _servicio.ObtenerInfoPorIdAsync(id);

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

                return(Ok(Json(entidad)));
            }
            catch (Exception)
            {
                return(BadRequest("The operation wasn't complete"));
            }
        }