Ejemplo n.º 1
0
        public async Task <ActionResult <Pet> > GetByIdAsync(int id)
        {
            var pet = await _repository.GetPetAsync(id);

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

            return(pet);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <Pet> > GetByIdAsync(int id)
        {
            var pet = await _repository.GetPetAsync(id);

            #region snippet_ProblemDetails_StatusCode
            if (pet == null)
            {
                return(NotFound());
            }
            #endregion

            return(pet);
        }