public DogDto Get(int id) { var dog = _dogRepository.Get(id); var dogDto = _mapper.Map <DogEntity, DogDto>(dog); return(dogDto); }
public async Task <Response <Dog> > Get(long id) { var dog = await dogRepository.Get(id); if (dog == null) { throw new BusinessException("El perrito ya fue adoptado o fue dado de baja del sistema"); } dog.Picture = (dog.Picture == null) ? new DogPicture() { Picture = pathOptions.Value.DefaultDogPicture } : new DogPicture() { Picture = pathOptions.Value.DogsPicturesPath + dog.Picture.Picture }; dog.Picture.PictureFile = fileUtil.GetFile(dog.Picture.Picture); return(new Response <Dog>(true, "", dog)); }