public async Task <IActionResult> OnPostAsync()
        {
            var gallery = new Gallery
            {
                UserId       = this.HttpContext.User.Identity.Name,
                GalleryId    = $"{this.Name}-{Guid.NewGuid().ToString()}",
                Name         = this.Name,
                Attributions = this.Attributions,
                IsPublic     = false,
                CreateDate   = DateTime.UtcNow,
                Status       = Gallery.Statuses.Importing
            };

            using (var stream = GalleryTilesSource.OpenReadStream())
            {
                await this._importJobMananger.StartGalleryImport(gallery.UserId, gallery.GalleryId, stream).ConfigureAwait(false);
            }

            await this._ddbContext.SaveAsync(gallery).ConfigureAwait(false);

            return(RedirectToPage("Galleries"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            var gallery = new Gallery
            {
                UserId       = this.HttpContext.User.Identity.Name,
                GalleryId    = this.GalleryId,
                Name         = this.Name,
                Attributions = this.Attributions,
                IsPublic     = this.IsPublic
            };

            if (GalleryTilesSource != null)
            {
                using (var stream = GalleryTilesSource.OpenReadStream())
                {
                    gallery.Status = Gallery.Statuses.Importing;
                    await this._importJobMananger.StartGalleryImport(gallery.UserId, gallery.GalleryId, stream).ConfigureAwait(false);
                }
            }

            await this._ddbContext.SaveAsync(gallery).ConfigureAwait(false);

            return(RedirectToPage("Galleries"));
        }