diff --git a/src/EventHub.Admin.Web/Pages/EventManagement.razor.cs b/src/EventHub.Admin.Web/Pages/EventManagement.razor.cs index 8240e2c..8f2cb29 100644 --- a/src/EventHub.Admin.Web/Pages/EventManagement.razor.cs +++ b/src/EventHub.Admin.Web/Pages/EventManagement.razor.cs @@ -159,11 +159,7 @@ namespace EventHub.Admin.Web.Pages await FileEntry.WriteToStreamAsync(stream); stream.Seek(0, SeekOrigin.Begin); - EditingEvent.CoverImageStreamContent = new RemoteStreamContent(stream) - { - ContentType = FileEntry.Type, - FileName = FileEntry.Name - }; + EditingEvent.CoverImageStreamContent = new RemoteStreamContent(stream, fileName: FileEntry.Name, contentType: FileEntry.Type); void SetCoverImageUrl(string contentType, byte[] content) { diff --git a/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor.cs b/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor.cs index de5936a..7e77881 100644 --- a/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor.cs +++ b/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor.cs @@ -122,11 +122,7 @@ namespace EventHub.Admin.Web.Pages await FileEntry.WriteToStreamAsync(stream); stream.Seek(0, SeekOrigin.Begin); - EditingOrganization.ProfilePictureStreamContent = new RemoteStreamContent(stream) - { - ContentType = FileEntry.Type, - FileName = FileEntry.Name - }; + EditingOrganization.ProfilePictureStreamContent = new RemoteStreamContent(stream, fileName: FileEntry.Name, contentType: FileEntry.Type); void SetProfileImageUrl(string contentType, byte[] content) { diff --git a/src/EventHub.Web/Pages/Events/Edit.cshtml.cs b/src/EventHub.Web/Pages/Events/Edit.cshtml.cs index 53420dd..a226659 100644 --- a/src/EventHub.Web/Pages/Events/Edit.cshtml.cs +++ b/src/EventHub.Web/Pages/Events/Edit.cshtml.cs @@ -66,11 +66,8 @@ namespace EventHub.Web.Pages.Events if (Event.CoverImageFile != null && Event.CoverImageFile.Length > 0) { await Event.CoverImageFile.CopyToAsync(memoryStream); - updateEventDto.CoverImageStreamContent = new RemoteStreamContent(memoryStream) - { - ContentType = Event.CoverImageFile.ContentType, - FileName = Event.CoverImageFile.FileName, - }; + + updateEventDto.CoverImageStreamContent = new RemoteStreamContent(memoryStream, fileName: Event.CoverImageFile.FileName, contentType: Event.CoverImageFile.ContentType); } await _eventAppService.UpdateAsync(Event.Id, updateEventDto); diff --git a/src/EventHub.Web/Pages/Events/New.cshtml.cs b/src/EventHub.Web/Pages/Events/New.cshtml.cs index 98e2e37..eea9cd9 100644 --- a/src/EventHub.Web/Pages/Events/New.cshtml.cs +++ b/src/EventHub.Web/Pages/Events/New.cshtml.cs @@ -65,11 +65,7 @@ namespace EventHub.Web.Pages.Events { await Event.CoverImageFile.CopyToAsync(memoryStream); - createEventDto.CoverImageStreamContent = new RemoteStreamContent(memoryStream) - { - ContentType = Event.CoverImageFile.ContentType, - FileName = Event.CoverImageFile.FileName - }; + createEventDto.CoverImageStreamContent = new RemoteStreamContent(memoryStream, fileName: Event.CoverImageFile.FileName, contentType: Event.CoverImageFile.ContentType); } var eventDto = await _eventAppService.CreateAsync(createEventDto); diff --git a/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs b/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs index b2f7c36..caaca2c 100644 --- a/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/Edit.cshtml.cs @@ -48,11 +48,8 @@ namespace EventHub.Web.Pages.Organizations if (Organization.ProfilePictureFile != null && Organization.ProfilePictureFile.Length > 0) { await Organization.ProfilePictureFile.CopyToAsync(memoryStream); - updateOrganizationDto.ProfilePictureStreamContent = new RemoteStreamContent(memoryStream) - { - ContentType = Organization.ProfilePictureFile.ContentType, - FileName = Organization.ProfilePictureFile.FileName, - }; + + updateOrganizationDto.ProfilePictureStreamContent = new RemoteStreamContent(memoryStream, fileName: Organization.ProfilePictureFile.FileName, contentType: Organization.ProfilePictureFile.ContentType); } await _organizationAppService.UpdateAsync(Organization.Id, updateOrganizationDto); diff --git a/src/EventHub.Web/Pages/Organizations/New.cshtml.cs b/src/EventHub.Web/Pages/Organizations/New.cshtml.cs index e7edcf6..e3bd8a0 100644 --- a/src/EventHub.Web/Pages/Organizations/New.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/New.cshtml.cs @@ -44,11 +44,7 @@ namespace EventHub.Web.Pages.Organizations { await Organization.ProfilePictureFile.CopyToAsync(memoryStream); - createOrganizationDto.ProfilePictureStreamContent = new RemoteStreamContent(memoryStream) - { - ContentType = Organization.ProfilePictureFile.ContentType, - FileName = Organization.ProfilePictureFile.FileName - }; + createOrganizationDto.ProfilePictureStreamContent = new RemoteStreamContent(memoryStream, fileName: Organization.ProfilePictureFile.FileName, contentType: Organization.ProfilePictureFile.ContentType); } await _organizationAppService.CreateAsync(createOrganizationDto);