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)); }
public async Task <IActionResult> GetImage(string dir, string name) { var array = await _imageService.GetImageAsync(dir, name); return(File(array, "image/jpeg")); }