diff --git a/src/EventHub.Application.Contracts/Events/CreateEventDto.cs b/src/EventHub.Application.Contracts/Events/CreateEventDto.cs index 801c904..a508867 100644 --- a/src/EventHub.Application.Contracts/Events/CreateEventDto.cs +++ b/src/EventHub.Application.Contracts/Events/CreateEventDto.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using JetBrains.Annotations; +using Volo.Abp.Content; namespace EventHub.Events { @@ -24,7 +25,7 @@ namespace EventHub.Events public string Description { get; set; } [CanBeNull] - public byte[] CoverImageContent { get; set; } + public IRemoteStreamContent CoverImageStreamContent { get; set; } public bool IsOnline { get; set; } diff --git a/src/EventHub.Application.Contracts/Events/EventDetailDto.cs b/src/EventHub.Application.Contracts/Events/EventDetailDto.cs index 6418a9e..ddb3eec 100644 --- a/src/EventHub.Application.Contracts/Events/EventDetailDto.cs +++ b/src/EventHub.Application.Contracts/Events/EventDetailDto.cs @@ -22,9 +22,7 @@ namespace EventHub.Events public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } - - public byte[] CoverImageContent { get; set; } - + public bool IsOnline { get; set; } public string OnlineLink { get; set; } diff --git a/src/EventHub.Application.Contracts/Events/EventInListDto.cs b/src/EventHub.Application.Contracts/Events/EventInListDto.cs index d6208c1..a2235ac 100644 --- a/src/EventHub.Application.Contracts/Events/EventInListDto.cs +++ b/src/EventHub.Application.Contracts/Events/EventInListDto.cs @@ -16,8 +16,6 @@ namespace EventHub.Events public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } - - public byte[] CoverImageContent { get; set; } public bool IsOnline { get; set; } diff --git a/src/EventHub.Application.Contracts/Events/IEventAppService.cs b/src/EventHub.Application.Contracts/Events/IEventAppService.cs index dd253d3..bd1238f 100644 --- a/src/EventHub.Application.Contracts/Events/IEventAppService.cs +++ b/src/EventHub.Application.Contracts/Events/IEventAppService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Content; namespace EventHub.Events { @@ -22,6 +23,6 @@ namespace EventHub.Events Task UpdateAsync(Guid id, UpdateEventDto input); - Task GetCoverImageAsync(Guid id); + Task GetCoverImageAsync(Guid id); } } diff --git a/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs b/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs index 82aae30..0e1edf6 100644 --- a/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs +++ b/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using JetBrains.Annotations; +using Volo.Abp.Content; namespace EventHub.Events { @@ -15,7 +16,7 @@ namespace EventHub.Events public string Description { get; set; } [CanBeNull] - public byte[] CoverImageContent { get; set; } + public IRemoteStreamContent CoverImageStreamContent { get; set; } [Required] [DataType(DataType.DateTime)] diff --git a/src/EventHub.Application/Events/EventAppService.cs b/src/EventHub.Application/Events/EventAppService.cs index 2bf29cb..22b3898 100644 --- a/src/EventHub.Application/Events/EventAppService.cs +++ b/src/EventHub.Application/Events/EventAppService.cs @@ -5,11 +5,11 @@ using System.Threading.Tasks; using EventHub.Countries; using EventHub.Events.Registrations; using EventHub.Organizations; -using EventHub.Users; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Authorization; using Volo.Abp.BlobStoring; +using Volo.Abp.Content; using Volo.Abp.Domain.Repositories; using Volo.Abp.Identity; using Volo.Abp.Users; @@ -73,9 +73,9 @@ namespace EventHub.Events await _eventManager.SetCapacityAsync(@event, input.Capacity); - if (input.CoverImageContent != null && input.CoverImageContent.Length > 0) + if (input.CoverImageStreamContent != null && input.CoverImageStreamContent.ContentLength > 0) { - await SaveCoverImageAsync(@event.Id, input.CoverImageContent); + await SaveCoverImageAsync(@event.Id, input.CoverImageStreamContent); } await _eventRepository.InsertAsync(@event); @@ -161,11 +161,6 @@ namespace EventHub.Events } ).ToList(); - foreach (var @event in events) - { - @event.CoverImageContent = await GetCoverImageAsync(@event.Id); - } - return new PagedResultDto(totalCount, events); } @@ -179,8 +174,7 @@ namespace EventHub.Events dto.OrganizationId = organization.Id; dto.OrganizationName = organization.Name; dto.OrganizationDisplayName = organization.DisplayName; - dto.CoverImageContent = await GetCoverImageAsync(dto.Id); - + var user = await _userRepository.GetAsync(organization.OwnerUserId); dto.OwnerUserName = user.UserName; dto.OwnerEmail = user.Email; @@ -254,26 +248,33 @@ namespace EventHub.Events @event.SetTime(input.StartTime, input.EndTime); await _eventManager.SetCapacityAsync(@event, input.Capacity); - if (input.CoverImageContent != null && input.CoverImageContent.Length > 0) + if (input.CoverImageStreamContent != null && input.CoverImageStreamContent.ContentLength > 0) { - await SaveCoverImageAsync(@event.Id, input.CoverImageContent); + await SaveCoverImageAsync(@event.Id, input.CoverImageStreamContent); } await _eventRepository.UpdateAsync(@event); } - public async Task GetCoverImageAsync(Guid id) + public async Task GetCoverImageAsync(Guid id) { var blobName = id.ToString(); - return await _eventBlobContainer.GetAllBytesOrNullAsync(blobName); + var coverImageStream = await _eventBlobContainer.GetOrNullAsync(blobName); + + if (coverImageStream is null) + { + return null; + } + + return new RemoteStreamContent(coverImageStream, blobName); } - private async Task SaveCoverImageAsync(Guid id, byte[] coverImageContent) + private async Task SaveCoverImageAsync(Guid id, IRemoteStreamContent streamContent) { var blobName = id.ToString(); - await _eventBlobContainer.SaveAsync(blobName, coverImageContent, overrideExisting: true); + await _eventBlobContainer.SaveAsync(blobName, streamContent.GetStream(), overrideExisting: true); } } } \ No newline at end of file diff --git a/src/EventHub.Application/Organizations/OrganizationAppService.cs b/src/EventHub.Application/Organizations/OrganizationAppService.cs index 03dd22e..0fb89de 100644 --- a/src/EventHub.Application/Organizations/OrganizationAppService.cs +++ b/src/EventHub.Application/Organizations/OrganizationAppService.cs @@ -146,22 +146,7 @@ namespace EventHub.Organizations await _organizationRepository.UpdateAsync(organization); } - - private async Task SaveProfilePictureAsync(Guid id, IRemoteStreamContent streamContent) - { - var organization = await _organizationRepository.GetAsync(x => x.Id == id); - - if (organization.OwnerUserId != CurrentUser.GetId()) - { - throw new AbpAuthorizationException(EventHubErrorCodes.NotAuthorizedToUpdateOrganizationProfile) - .WithData("Name", organization.DisplayName); - } - - var blobName = id.ToString(); - - await _organizationBlobContainer.SaveAsync(blobName, streamContent.GetStream(), overrideExisting: true); - } - + public async Task GetProfilePictureAsync(Guid id) { var blobName = id.ToString(); @@ -175,5 +160,12 @@ namespace EventHub.Organizations return new RemoteStreamContent(pictureContent, blobName); } + + private async Task SaveProfilePictureAsync(Guid id, IRemoteStreamContent streamContent) + { + var blobName = id.ToString(); + + await _organizationBlobContainer.SaveAsync(blobName, streamContent.GetStream(), overrideExisting: true); + } } } \ No newline at end of file diff --git a/src/EventHub.HttpApi.Host/Controllers/Events/EventController.cs b/src/EventHub.HttpApi.Host/Controllers/Events/EventController.cs index b1f6e34..ba988fc 100644 --- a/src/EventHub.HttpApi.Host/Controllers/Events/EventController.cs +++ b/src/EventHub.HttpApi.Host/Controllers/Events/EventController.cs @@ -6,6 +6,8 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Content; +using Volo.Abp.VirtualFileSystem; namespace EventHub.Controllers.Events { @@ -16,10 +18,14 @@ namespace EventHub.Controllers.Events public class EventController : AbpController, IEventAppService { private readonly IEventAppService _eventAppService; + private readonly IVirtualFileProvider _virtualFileProvider; - public EventController(IEventAppService eventAppService) + public EventController( + IEventAppService eventAppService, + IVirtualFileProvider virtualFileProvider) { _eventAppService = eventAppService; + _virtualFileProvider = virtualFileProvider; } [HttpPost] @@ -71,9 +77,21 @@ namespace EventHub.Controllers.Events [HttpGet] [Route("cover-image/{id}")] - public async Task GetCoverImageAsync(Guid id) + public async Task GetCoverImageAsync(Guid id) { - return await _eventAppService.GetCoverImageAsync(id); + var remoteStreamContent = await _eventAppService.GetCoverImageAsync(id); + + if (remoteStreamContent is null) + { + var stream = _virtualFileProvider.GetFileInfo("/Images/eh-event.png").CreateReadStream(); + remoteStreamContent = new RemoteStreamContent(stream); + await stream.FlushAsync(); + } + + Response.Headers.Add("Accept-Ranges", "bytes"); + Response.ContentType = remoteStreamContent.ContentType; + + return remoteStreamContent; } } } \ No newline at end of file diff --git a/src/EventHub.HttpApi.Host/Controllers/Organizations/OrganizationController.cs b/src/EventHub.HttpApi.Host/Controllers/Organizations/OrganizationController.cs index a921baf..4c94f8d 100644 --- a/src/EventHub.HttpApi.Host/Controllers/Organizations/OrganizationController.cs +++ b/src/EventHub.HttpApi.Host/Controllers/Organizations/OrganizationController.cs @@ -75,7 +75,7 @@ namespace EventHub.Controllers.Organizations if (remoteStreamContent is null) { - await using var stream = _virtualFileProvider.GetFileInfo("/Controllers/Organizations/ProfilePictures/eh-organization.png").CreateReadStream(); + var stream = _virtualFileProvider.GetFileInfo("/Images/eh-organization.png").CreateReadStream(); remoteStreamContent = new RemoteStreamContent(stream); await stream.FlushAsync(); } diff --git a/src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj b/src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj index 5416adb..7c30386 100644 --- a/src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj +++ b/src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj @@ -33,7 +33,7 @@ - + diff --git a/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs b/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs index 945c1aa..a9eceb1 100644 --- a/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs +++ b/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs @@ -11,6 +11,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using EventHub.EntityFrameworkCore; +using EventHub.Events; using EventHub.Organizations; using EventHub.Utils; using EventHub.Web; @@ -71,6 +72,8 @@ namespace EventHub { options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(CreateOrganizationDto)); options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(UpdateOrganizationDto)); + options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(CreateEventDto)); + options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(UpdateEventDto)); }); } @@ -95,7 +98,7 @@ namespace EventHub { options.FileSets.AddEmbedded( baseNamespace: "EventHub", - baseFolder: "/Controllers/Organizations/ProfilePictures"); + baseFolder: "/Images"); if (hostingEnvironment.IsDevelopment()) { diff --git a/src/EventHub.HttpApi.Host/Images/eh-event.png b/src/EventHub.HttpApi.Host/Images/eh-event.png new file mode 100644 index 0000000..b49547e Binary files /dev/null and b/src/EventHub.HttpApi.Host/Images/eh-event.png differ diff --git a/src/EventHub.HttpApi.Host/Controllers/Organizations/ProfilePictures/eh-organization.png b/src/EventHub.HttpApi.Host/Images/eh-organization.png similarity index 100% rename from src/EventHub.HttpApi.Host/Controllers/Organizations/ProfilePictures/eh-organization.png rename to src/EventHub.HttpApi.Host/Images/eh-organization.png diff --git a/src/EventHub.Web/Controllers/EventController.cs b/src/EventHub.Web/Controllers/EventController.cs index f5497f3..fcc385b 100644 --- a/src/EventHub.Web/Controllers/EventController.cs +++ b/src/EventHub.Web/Controllers/EventController.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Threading.Tasks; using EventHub.Events; @@ -29,19 +28,5 @@ namespace EventHub.Web.Controllers ViewData = ViewData }; } - - [HttpGet] - [Route("cover-picture-source/{eventId}")] - public async Task GetArticleCoverImageAsync(Guid eventId) - { - var coverImageContent = await _eventAppService.GetCoverImageAsync(eventId); - - if (coverImageContent == null) - { - return NotFound(); - } - - return File(coverImageContent, "image/jpeg"); - } } } \ No newline at end of file diff --git a/src/EventHub.Web/EventHubWebAutoMapperProfile.cs b/src/EventHub.Web/EventHubWebAutoMapperProfile.cs index 94e74fc..014ea33 100644 --- a/src/EventHub.Web/EventHubWebAutoMapperProfile.cs +++ b/src/EventHub.Web/EventHubWebAutoMapperProfile.cs @@ -13,7 +13,7 @@ namespace EventHub.Web { CreateMap(); CreateMap() - .Ignore(x => x.CoverImageContent); + .Ignore(x => x.CoverImageStreamContent); CreateMap(); CreateMap(); CreateMap(); diff --git a/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml b/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml index 20d23e6..e8e5ba0 100644 --- a/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml +++ b/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml @@ -1,22 +1,16 @@ @using System.Globalization -@using EventHub.Web.Helpers +@using EventHub.Web @using EventHub.Web.Pages.Events +@using Microsoft.Extensions.Options @model List +@inject IOptions UrlOptions @foreach (var eventDto in Model) {
- @if (eventDto.CoverImageContent is null) - { -
-
- } - else - { -
-
- } +
+
@@ -32,7 +26,7 @@ @eventDto.StartTime.ToString("hh tt", CultureInfo.InvariantCulture) - @eventDto.EndTime.ToString("hh tt", CultureInfo.InvariantCulture) | @EventDateHelper.GetLocationInfo(eventDto)

@eventDto.Description

- Learn More + Learn More
diff --git a/src/EventHub.Web/Pages/Events/Detail.cshtml b/src/EventHub.Web/Pages/Events/Detail.cshtml index 9c0c15e..67c825b 100644 --- a/src/EventHub.Web/Pages/Events/Detail.cshtml +++ b/src/EventHub.Web/Pages/Events/Detail.cshtml @@ -24,17 +24,7 @@ @{ string description = Model.Event.Description.Length >= 160 ? Model.Event.Description.TruncateWithPostfix(155) : Model.Event.Description; string title = Model.Event.Title; - string coverImageUrl; - - if (Model.Event.CoverImageContent is null) - { - // TODO(berkansasmaz): Get a default image from the design team to be used in social media posts - coverImageUrl = UrlOptions.Value.Www + "/assets/slide.jpg"; - } - else - { - coverImageUrl = $"{UrlOptions.Value.Www}/api/event/cover-picture-source/{Model.Event.Id}"; - } + string coverImageUrl = UrlOptions.Value.Api.EnsureEndsWith('/') + $"api/eventhub/event/cover-image/{Model.Event.Id}"; ViewBag.Title = title; ViewBag.Description = description; @@ -52,14 +42,7 @@
- @if (Model.Event.CoverImageContent == null) - { - @Model.Event.Title - } - else - { - @Model.Event.Title - } + @Model.Event.Title
diff --git a/src/EventHub.Web/Pages/Events/Edit.cshtml b/src/EventHub.Web/Pages/Events/Edit.cshtml index c5d3d40..dfe4c1d 100644 --- a/src/EventHub.Web/Pages/Events/Edit.cshtml +++ b/src/EventHub.Web/Pages/Events/Edit.cshtml @@ -1,8 +1,11 @@ @page "/event/edit/{url}" @inject IHtmlLocalizer L @using EventHub.Localization +@using EventHub.Web @using Microsoft.AspNetCore.Mvc.Localization +@using Microsoft.Extensions.Options @model EventHub.Web.Pages.Events.EditPageModel +@inject IOptions UrlOptions @section scripts { @@ -62,14 +65,7 @@
- @if (Model.CoverImageContent != null && Model.CoverImageContent.Length > 0) - { - - } - else - { - - } +
diff --git a/src/EventHub.Web/Pages/Events/Edit.cshtml.cs b/src/EventHub.Web/Pages/Events/Edit.cshtml.cs index d1f00f5..05bd3fe 100644 --- a/src/EventHub.Web/Pages/Events/Edit.cshtml.cs +++ b/src/EventHub.Web/Pages/Events/Edit.cshtml.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using NUglify.Helpers; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; +using Volo.Abp.Content; using Volo.Abp.Users; namespace EventHub.Web.Pages.Events @@ -30,7 +31,6 @@ namespace EventHub.Web.Pages.Events public List Organizations { get; private set; } public List Countries { get; private set; } public List Languages { get; private set; } - public byte[] CoverImageContent { get; private set; } private readonly IEventAppService _eventAppService; private readonly IOrganizationAppService _organizationAppService; @@ -47,7 +47,7 @@ namespace EventHub.Web.Pages.Events { var urlCode = EventUrlCodeHelper.GetCodeFromUrl(Url); var eventDetailDto = await _eventAppService.GetByUrlCodeAsync(urlCode); - CoverImageContent = eventDetailDto.CoverImageContent; + Event = ObjectMapper.Map(eventDetailDto); await FillOrganizationsAsync(); @@ -61,19 +61,22 @@ namespace EventHub.Web.Pages.Events { ValidateModel(); - var input = ObjectMapper.Map(Event); + var updateEventDto = ObjectMapper.Map(Event); + await using var memoryStream = new MemoryStream(); if (Event.CoverImageFile != null && Event.CoverImageFile.Length > 0) { - using (var memoryStream = new MemoryStream()) + await Event.CoverImageFile.CopyToAsync(memoryStream); + updateEventDto.CoverImageStreamContent = new RemoteStreamContent(memoryStream) { - await Event.CoverImageFile.CopyToAsync(memoryStream); - input.CoverImageContent = memoryStream.ToArray(); - } + ContentType = Event.CoverImageFile.ContentType, + FileName = Event.CoverImageFile.FileName, + }; } - await _eventAppService.UpdateAsync(Event.Id, input); - + await _eventAppService.UpdateAsync(Event.Id, updateEventDto); + await memoryStream.DisposeAsync(); + return RedirectToPage("./Detail", new { url = Url }); } catch (Exception exception) diff --git a/src/EventHub.Web/Pages/Events/New.cshtml.cs b/src/EventHub.Web/Pages/Events/New.cshtml.cs index da2afbf..671e7a7 100644 --- a/src/EventHub.Web/Pages/Events/New.cshtml.cs +++ b/src/EventHub.Web/Pages/Events/New.cshtml.cs @@ -15,13 +15,15 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using NUglify.Helpers; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; +using Volo.Abp.Content; using Volo.Abp.Users; namespace EventHub.Web.Pages.Events { public class NewPageModel : EventHubPageModel { - [BindProperty] public NewEventViewModel Event { get; set; } + [BindProperty] + public NewEventViewModel Event { get; set; } public List Organizations { get; private set; } public List Countries { get; private set; } @@ -57,18 +59,22 @@ namespace EventHub.Web.Pages.Events { ValidateModel(); - var input = ObjectMapper.Map(Event); + var createEventDto = ObjectMapper.Map(Event); + await using var memoryStream = new MemoryStream(); if (Event.CoverImageFile != null && Event.CoverImageFile.Length > 0) { - using (var memoryStream = new MemoryStream()) + await Event.CoverImageFile.CopyToAsync(memoryStream); + + createEventDto.CoverImageStreamContent = new RemoteStreamContent(memoryStream) { - await Event.CoverImageFile.CopyToAsync(memoryStream); - input.CoverImageContent = memoryStream.ToArray(); - } + ContentType = Event.CoverImageFile.ContentType, + FileName = Event.CoverImageFile.FileName + }; } - var eventDto = await _eventAppService.CreateAsync(input); + var eventDto = await _eventAppService.CreateAsync(createEventDto); + await memoryStream.DisposeAsync(); return RedirectToPage("/Events/Detail", new {url = eventDto.UrlCode}); } diff --git a/src/EventHub.Web/Pages/Index.cshtml b/src/EventHub.Web/Pages/Index.cshtml index b5e6042..0bc2774 100644 --- a/src/EventHub.Web/Pages/Index.cshtml +++ b/src/EventHub.Web/Pages/Index.cshtml @@ -152,16 +152,8 @@
- @if (Model.OnlineEvents[i].CoverImageContent is null) - { -
-
- } - else - { -
-
- } +
+
@@ -171,7 +163,7 @@ @Model.OnlineEvents[i].StartTime.ToString("MMMM dd, yyyy dddd")
@Model.OnlineEvents[i].StartTime.ToString("hh tt", CultureInfo.InvariantCulture) - @Model.OnlineEvents[i].EndTime.ToString("hh tt", CultureInfo.InvariantCulture) | Online

@Model.OnlineEvents[i].Description

- Learn More + Learn More
@@ -182,16 +174,8 @@
- @if (Model.OnlineEvents[i + 1].CoverImageContent is null) - { -
-
- } - else - { -
-
- } +
+
diff --git a/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs b/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs index d31be7a..b2f7c36 100644 --- a/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs @@ -56,6 +56,7 @@ namespace EventHub.Web.Pages.Organizations } await _organizationAppService.UpdateAsync(Organization.Id, updateOrganizationDto); + await memoryStream.DisposeAsync(); return RedirectToPage("./Profile", new { name = Name }); } diff --git a/src/EventHub.Web/Pages/Organizations/New.cshtml.cs b/src/EventHub.Web/Pages/Organizations/New.cshtml.cs index b895e22..e7edcf6 100644 --- a/src/EventHub.Web/Pages/Organizations/New.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/New.cshtml.cs @@ -52,7 +52,7 @@ namespace EventHub.Web.Pages.Organizations } await _organizationAppService.CreateAsync(createOrganizationDto); - await memoryStream.FlushAsync(); + await memoryStream.DisposeAsync(); return RedirectToPage("./Profile", new {name = Organization.Name}); }