コード例 #1
0
        /// <summary>
        /// Upload and image to the blob, save it to database, and add to gallery.
        /// </summary>
        /// <param name="files"> list of files to be uploaded </param>
        /// <returns></returns>
        public async Task OnPostAddImages(IFormFile[] files)
        {
            Image image = new Image();

            foreach (var file in files)
            {
                if (file != null)
                {
                    image = await _upload.AddArtImage(file);

                    await _art.AddImageToGallery(PageToggles.GalleryId, image.Id);
                }
            }
            PageToggles.ActiveGalleryAdmin = true;
            await Refresh();

            Redirect("/Art/ScottFalboArt");
        }