public async Task <IActionResult> GetPhoto(int id)
        {
            var photoFromRepo = await photosRepository.GetPhoto(id);

            var photo = mapper.Map <PhotoForReturnDto>(photoFromRepo);

            return(Ok(photo));
        }
Exemple #2
0
        public byte[] GetPhotoData(int photoId)
        {
            var photo = _photosRepository.GetPhoto(photoId);

            if (photo == null)
            {
                return(null);
            }
            var photoData = File.ReadAllBytes(GetImageDirectoryPath(photo.PhotoName));

            return(photoData);
        }
 public async Task <Photo> GetPhoto(int id)
 {
     return(await _photosRepo.GetPhoto(id));
 }
Exemple #4
0
 public Photo GetPhoto(int photoId)
 {
     return(_repository.GetPhoto(photoId));
 }
 public async Task <PhotoForReturnModel> GetPhoto(int id)
 {
     return(await _repo.GetPhoto(id));
 }