public async Task <ActionResult> GetImage(int id) { var category = new CategoryViewModel() { Id = id }; category.Picture = await _dictionaryService.CategoryGetPictureAsync(id); return(File(category.Image, "image/png")); }
public async Task <ActionResult <byte[]> > GetImage(int id) { var category = new CategoryViewModel() { Id = id, Picture = await _dictionaryService.CategoryGetPictureAsync(id) }; if (category.Picture == null) { return(NotFound()); } return(category.Picture); }