Beispiel #1
0
        public async Task <IActionResult> Get(long id)
        {
            var pet = await _petsRepository.GetPetAsync(id);

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

            var petToReturn = AutoMapper.Mapper.Map <PetDto>(pet);

            petToReturn.PopulateLinks(_urlHelper);

            return(Ok(petToReturn));
        }