예제 #1
0
        public async Task <IActionResult> GetImage(Guid id)
        {
            var imageFromRepo = await _imagesService.GetImageAsync(id);

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

            var imageToReturn = _mapper.Map <ImageModel>(imageFromRepo);

            return(Ok(imageToReturn));
        }
예제 #2
0
        public async Task <IActionResult> GetImage(string dir, string name)
        {
            var array = await _imageService.GetImageAsync(dir, name);

            return(File(array, "image/jpeg"));
        }