From e5d142241d49812ea26e844daa1baf9578dbf9d8 Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Fri, 5 Jan 2024 14:28:42 +0000 Subject: [PATCH 1/3] Update packages (#1056) --- .../SimplCommerce.Module.EmailSenderSendgrid.csproj | 2 +- .../EmailSender.cs | 4 ++-- .../SimplCommerce.Module.EmailSenderSmtp.csproj | 2 +- .../SimplCommerce.Module.PaymentBraintree.csproj | 2 +- .../SimplCommerce.Module.StorageAmazonS3.csproj | 2 +- .../SimplCommerce.Module.StorageAzureBlob.csproj | 2 +- .../SimplCommerce.Infrastructure.csproj | 7 ++++--- src/SimplCommerce.WebHost/Program.cs | 5 ++--- src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj | 10 +++++----- .../SimplCommerce.Infrastructure.Tests.csproj | 2 +- .../SimplCommerce.Module.Cms.Tests.csproj | 8 ++++---- .../SimplCommerce.Module.Core.Tests.csproj | 8 ++++---- .../SimplCommerce.Module.Inventory.Tests.csproj | 8 ++++---- .../SimplCommerce.Module.Pricing.Tests.csproj | 8 ++++---- 14 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/Modules/SimplCommerce.Module.EmailSenderSendgrid/SimplCommerce.Module.EmailSenderSendgrid.csproj b/src/Modules/SimplCommerce.Module.EmailSenderSendgrid/SimplCommerce.Module.EmailSenderSendgrid.csproj index 0dc126043a..01d6efad1d 100644 --- a/src/Modules/SimplCommerce.Module.EmailSenderSendgrid/SimplCommerce.Module.EmailSenderSendgrid.csproj +++ b/src/Modules/SimplCommerce.Module.EmailSenderSendgrid/SimplCommerce.Module.EmailSenderSendgrid.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Modules/SimplCommerce.Module.EmailSenderSmtp/EmailSender.cs b/src/Modules/SimplCommerce.Module.EmailSenderSmtp/EmailSender.cs index 51c5a640eb..8ddccd9c93 100644 --- a/src/Modules/SimplCommerce.Module.EmailSenderSmtp/EmailSender.cs +++ b/src/Modules/SimplCommerce.Module.EmailSenderSmtp/EmailSender.cs @@ -22,8 +22,8 @@ public EmailSender(IConfiguration config) public async Task SendEmailAsync(string email, string subject, string body, bool isHtml = false) { var message = new MimeMessage(); - message.From.Add(new MailboxAddress(_emailConfig.SmtpUsername)); - message.To.Add(new MailboxAddress(email)); + message.From.Add(new MailboxAddress(_emailConfig.SmtpUsername, _emailConfig.SmtpUsername)); + message.To.Add(new MailboxAddress(email, email)); message.Subject = subject; var textFormat = isHtml ? TextFormat.Html : TextFormat.Plain; diff --git a/src/Modules/SimplCommerce.Module.EmailSenderSmtp/SimplCommerce.Module.EmailSenderSmtp.csproj b/src/Modules/SimplCommerce.Module.EmailSenderSmtp/SimplCommerce.Module.EmailSenderSmtp.csproj index 0bf002a44a..4eaf81e8b9 100644 --- a/src/Modules/SimplCommerce.Module.EmailSenderSmtp/SimplCommerce.Module.EmailSenderSmtp.csproj +++ b/src/Modules/SimplCommerce.Module.EmailSenderSmtp/SimplCommerce.Module.EmailSenderSmtp.csproj @@ -2,7 +2,7 @@ - + diff --git a/src/Modules/SimplCommerce.Module.PaymentBraintree/SimplCommerce.Module.PaymentBraintree.csproj b/src/Modules/SimplCommerce.Module.PaymentBraintree/SimplCommerce.Module.PaymentBraintree.csproj index 0c4aecaf8d..ea6c618da4 100644 --- a/src/Modules/SimplCommerce.Module.PaymentBraintree/SimplCommerce.Module.PaymentBraintree.csproj +++ b/src/Modules/SimplCommerce.Module.PaymentBraintree/SimplCommerce.Module.PaymentBraintree.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Modules/SimplCommerce.Module.StorageAmazonS3/SimplCommerce.Module.StorageAmazonS3.csproj b/src/Modules/SimplCommerce.Module.StorageAmazonS3/SimplCommerce.Module.StorageAmazonS3.csproj index 4bf139dcb4..313c5014f5 100644 --- a/src/Modules/SimplCommerce.Module.StorageAmazonS3/SimplCommerce.Module.StorageAmazonS3.csproj +++ b/src/Modules/SimplCommerce.Module.StorageAmazonS3/SimplCommerce.Module.StorageAmazonS3.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Modules/SimplCommerce.Module.StorageAzureBlob/SimplCommerce.Module.StorageAzureBlob.csproj b/src/Modules/SimplCommerce.Module.StorageAzureBlob/SimplCommerce.Module.StorageAzureBlob.csproj index b05016c75b..f43c13de95 100644 --- a/src/Modules/SimplCommerce.Module.StorageAzureBlob/SimplCommerce.Module.StorageAzureBlob.csproj +++ b/src/Modules/SimplCommerce.Module.StorageAzureBlob/SimplCommerce.Module.StorageAzureBlob.csproj @@ -1,7 +1,7 @@ - + diff --git a/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj b/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj index 03b87b25bd..96f9873feb 100644 --- a/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj +++ b/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj @@ -12,9 +12,10 @@ - - - + + + + diff --git a/src/SimplCommerce.WebHost/Program.cs b/src/SimplCommerce.WebHost/Program.cs index 54cb76ddb9..520f2f0737 100644 --- a/src/SimplCommerce.WebHost/Program.cs +++ b/src/SimplCommerce.WebHost/Program.cs @@ -2,8 +2,8 @@ using System.Linq; using System.Text.Encodings.Web; using System.Text.Unicode; -using MediatR; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.EntityFrameworkCore; @@ -73,8 +73,7 @@ void ConfigureService() } } - builder.Services.AddScoped(p => p.GetService); - builder.Services.AddScoped(); + builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Program).Assembly)); builder.Services.AddSwaggerGen(c => { diff --git a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj index 1061a94ccf..0b442a9717 100644 --- a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj +++ b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj @@ -55,7 +55,7 @@ - + @@ -67,11 +67,11 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + diff --git a/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj b/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj index 4f000cd0ca..e1d024ed40 100644 --- a/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj +++ b/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj @@ -12,7 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj b/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj index 20258c9b9b..bf39566b4b 100644 --- a/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj +++ b/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj @@ -7,13 +7,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj b/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj index 64c9a79902..eee1c1d78b 100644 --- a/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj +++ b/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj @@ -7,13 +7,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj b/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj index a24cab0278..944ea071c9 100644 --- a/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj +++ b/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj @@ -8,13 +8,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj b/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj index 6b16f773c1..33b7660809 100644 --- a/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj +++ b/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj @@ -7,13 +7,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers From 652fcc9a8d4082fbe615b90e32c684347f7a7ebb Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Fri, 5 Jan 2024 15:07:01 +0000 Subject: [PATCH 2/3] Upgrade to .NET 8.0 (#1070) --- .travis.yml | 2 +- azure-pipelines.yml | 8 ++++---- global.json | 6 +++--- src/Modules/Directory.Build.props | 2 +- .../SimplCommerce.Infrastructure.csproj | 2 +- src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj | 2 +- .../SimplCommerce.Infrastructure.Tests.csproj | 2 +- .../SimplCommerce.Module.Cms.Tests.csproj | 2 +- .../SimplCommerce.Module.Core.Tests.csproj | 2 +- .../SimplCommerce.Module.Inventory.Tests.csproj | 2 +- .../SimplCommerce.Module.Pricing.Tests.csproj | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc3295bb39..05058584ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: csharp solution: SimplCommerce.sln sudo: required dist: xenial -dotnet: 7.0.111 +dotnet: 8.0.100 mono: none os: - linux diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4586e3794d..b61127af20 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,7 +15,7 @@ jobs: displayName: 'Use .NET Core sdk' inputs: packageType: 'sdk' - version: '7.0.111' + version: '8.0.100' - script: dotnet build ./SimplCommerce.sln displayName: 'dotnet build' - task: DotNetCoreCLI@2 @@ -47,7 +47,7 @@ jobs: displayName: 'Use .NET Core sdk' inputs: packageType: 'sdk' - version: '7.0.111' + version: '8.0.100' - script: dotnet build ./SimplCommerce.sln displayName: 'dotnet build' - task: DotNetCoreCLI@2 @@ -79,7 +79,7 @@ jobs: displayName: 'Use .NET Core sdk' inputs: packageType: 'sdk' - version: '7.0.111' + version: '8.0.100' - task: DotNetCoreCLI@2 displayName: 'Restoring code using dotnet restore' inputs: @@ -119,7 +119,7 @@ jobs: displayName: 'Use .NET Core sdk' inputs: packageType: 'sdk' - version: '7.0.111' + version: '8.0.100' - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' - task: DotNetCoreCLI@2 diff --git a/global.json b/global.json index 77a73a039e..846e95b7c3 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "7.0.101", - "rollForward": "latestMinor", - "allowPrerelease": false + "version": "8.0.0", + "rollForward": "latestMinor", + "allowPrerelease": false } } \ No newline at end of file diff --git a/src/Modules/Directory.Build.props b/src/Modules/Directory.Build.props index 698e035509..c3a1f13d06 100644 --- a/src/Modules/Directory.Build.props +++ b/src/Modules/Directory.Build.props @@ -1,6 +1,6 @@ - net7.0 + net8.0 true false diff --git a/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj b/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj index 96f9873feb..750c71ed23 100644 --- a/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj +++ b/src/SimplCommerce.Infrastructure/SimplCommerce.Infrastructure.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj index 0b442a9717..e3a2121cbc 100644 --- a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj +++ b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 aspnet-Modular.WebHost-dca604fa-ee10-4a6c-8e7d-8cc79dca8c8f false false diff --git a/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj b/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj index e1d024ed40..5087d7a55c 100644 --- a/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj +++ b/test/SimplCommerce.Infrastructure.Tests/SimplCommerce.Infrastructure.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj b/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj index bf39566b4b..043e2f8aa4 100644 --- a/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj +++ b/test/SimplCommerce.Module.Cms.Tests/SimplCommerce.Module.Cms.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj b/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj index eee1c1d78b..d685a5739b 100644 --- a/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj +++ b/test/SimplCommerce.Module.Core.Tests/SimplCommerce.Module.Core.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj b/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj index 944ea071c9..533b482543 100644 --- a/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj +++ b/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj b/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj index 33b7660809..c14e350893 100644 --- a/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj +++ b/test/SimplCommerce.Module.Pricing.Tests/SimplCommerce.Module.Pricing.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false From 6a170abaf6701e9780fa12640f35697dc1fa55fb Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Fri, 5 Jan 2024 15:21:28 +0000 Subject: [PATCH 3/3] Update net7.0 packages (#1071) --- .../Migrations/20230930154048_InitDb.Designer.cs | 2 +- .../Migrations/SimplDbContextModelSnapshot.cs | 2 +- .../SimplCommerce.WebHost.csproj | 12 ++++++------ .../SimplCommerce.Module.Inventory.Tests.csproj | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/SimplCommerce.WebHost/Migrations/20230930154048_InitDb.Designer.cs b/src/SimplCommerce.WebHost/Migrations/20230930154048_InitDb.Designer.cs index add23681c6..cdf9e86cd6 100644 --- a/src/SimplCommerce.WebHost/Migrations/20230930154048_InitDb.Designer.cs +++ b/src/SimplCommerce.WebHost/Migrations/20230930154048_InitDb.Designer.cs @@ -20,7 +20,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("ProductVersion", "8.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); diff --git a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs b/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs index 666f2ff2cc..4e199f920c 100644 --- a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs +++ b/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("ProductVersion", "8.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); diff --git a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj index e3a2121cbc..7c01d06b4c 100644 --- a/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj +++ b/src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj @@ -58,15 +58,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj b/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj index 533b482543..cff4341f58 100644 --- a/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj +++ b/test/SimplCommerce.Module.Inventory.Tests/SimplCommerce.Module.Inventory.Tests.csproj @@ -6,7 +6,7 @@ - +