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

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

            return(Ok(photo));
        }
Example #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));
 }
Example #4
0
 public Photo GetPhoto(int photoId)
 {
     return(_repository.GetPhoto(photoId));
 }
Example #5
0
 public async Task <PhotoForReturnModel> GetPhoto(int id)
 {
     return(await _repo.GetPhoto(id));
 }