示例#1
0
        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"));
        }
示例#2
0
        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);
        }