Exemple #1
0
        private async Task UpdateModel(Guid imageId)
        {
            string url = Request.GetAppBaseUrl();

            Image = await _imagesService.FetchImageById(imageId);

            ImageUrl   = new Uri($@"{url}/api/v1.0/image-file/{Image.Id}");
            ImageLinks = await _recordImagesService.GetLinkedRecordsInfo(imageId);
        }
        public async Task <IActionResult> GetImageThumbnail(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest());
            }

            try
            {
                var image = await _imagesService.FetchImageById(id);

                return(File(image.Thumbnail, "image/jpeg"));
            }
            catch (ArgumentException)
            {
                return(NotFound());
            }
        }