From b2e16adb329489e24e92ea1a1b5408379c75806d Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 26 Oct 2023 12:01:12 +0330 Subject: [PATCH 1/3] add if for whitelabel config --- .../StartUpExtensions.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/StartUpExtensions.cs b/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/StartUpExtensions.cs index ccf93b0..9bf079a 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/StartUpExtensions.cs +++ b/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/StartUpExtensions.cs @@ -16,6 +16,7 @@ using System.Linq; using System.Net; using System.Net.Mime; +using System.Text; using System.Text.Json; using System.Threading.Tasks; @@ -109,8 +110,11 @@ public static async Task Build(this IApplicationBuilder app) var dbbuilder = new DatabaseCreator(); using var context = scope.ServiceProvider.GetRequiredService(); dbbuilder.Initialize(context); - using var uow = scope.ServiceProvider.GetRequiredService() as UnitOfWork; - await uow.Initialize(MicroserviceName, config.GetValue(ConfigName), typeof(TContext)).ConfigureAwait(false); + if (WhiteLabelRoute.HasValue() || ConfigName.HasValue()) + { + using var uow = scope.ServiceProvider.GetRequiredService() as UnitOfWork; + await uow.Initialize(MicroserviceName, config.GetValue(ConfigName), typeof(TContext)).ConfigureAwait(false); + } } var build = app.Build(); app.Run(build); @@ -179,7 +183,11 @@ public static async Task Build(this WebApplicationBuil using var context = scope.ServiceProvider.GetRequiredService(); dbbuilder.Initialize(context); using var uow = scope.ServiceProvider.GetRequiredService() as UnitOfWork; - await uow.Initialize(MicroserviceName, WhiteLabelRoute ?? config.GetValue(ConfigName), typeof(TContext)).ConfigureAwait(false); + if (WhiteLabelRoute.HasValue() || ConfigName.HasValue()) + { + var value = WhiteLabelRoute ?? config.GetValue(ConfigName); + await uow.Initialize(MicroserviceName, WhiteLabelRoute ?? config.GetValue(ConfigName), typeof(TContext)).ConfigureAwait(false); + } } return build; } From e0f80bf8b78ea63f1201d6b869d8ce81190a4c8e Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 26 Oct 2023 12:01:47 +0330 Subject: [PATCH 2/3] add version --- .../EasyMicroservices.Cores.AspCoreApi.csproj | 2 +- .../EasyMicroservices.Cores.AspEntityFrameworkCoreApi.csproj | 2 +- .../EasyMicroservices.Cores.Contracts.csproj | 2 +- .../EasyMicroservices.Cores.Database.csproj | 2 +- .../EasyMicroservices.Cores.EntityFrameworkCore.csproj | 2 +- ...asyMicroservices.Cores.Relational.EntityFrameworkCore.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj b/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj index 55d43e9..1d4ebf1 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj +++ b/src/CSharp/EasyMicroservices.Cores.AspCoreApi/EasyMicroservices.Cores.AspCoreApi.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.41 + 0.0.0.42 asp core servces. EasyMicroservices@gmail.com core,cores,base,database,services,asp,aspnet diff --git a/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/EasyMicroservices.Cores.AspEntityFrameworkCoreApi.csproj b/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/EasyMicroservices.Cores.AspEntityFrameworkCoreApi.csproj index 51e0e5c..2b3bab3 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/EasyMicroservices.Cores.AspEntityFrameworkCoreApi.csproj +++ b/src/CSharp/EasyMicroservices.Cores.AspEntityFrameworkCoreApi/EasyMicroservices.Cores.AspEntityFrameworkCoreApi.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.41 + 0.0.0.42 asp core servces. EasyMicroservices@gmail.com core,cores,base,database,services,asp,aspnet,aspcore,efcore diff --git a/src/CSharp/EasyMicroservices.Cores.Contracts/EasyMicroservices.Cores.Contracts.csproj b/src/CSharp/EasyMicroservices.Cores.Contracts/EasyMicroservices.Cores.Contracts.csproj index bd0dcb4..14a75ff 100644 --- a/src/CSharp/EasyMicroservices.Cores.Contracts/EasyMicroservices.Cores.Contracts.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Contracts/EasyMicroservices.Cores.Contracts.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.41 + 0.0.0.42 core contracts. EasyMicroservices@gmail.com core,cores,base,contract,contracts,dto,dtos diff --git a/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj b/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj index bfc6b1b..6c51bf1 100644 --- a/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Database/EasyMicroservices.Cores.Database.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.41 + 0.0.0.42 core of database. EasyMicroservices@gmail.com core,cores,base,database diff --git a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj index de20e1c..bd06ce0 100644 --- a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.41 + 0.0.0.42 ef core of database. EasyMicroservices@gmail.com core,cores,base,database,ef,efcore diff --git a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj index 072b039..bbc6417 100644 --- a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.41 + 0.0.0.42 ef core of Relational database. EasyMicroservices@gmail.com core,cores,base,database,ef,efcore,Relational From ca315b1151c02cc49e73586070aeeb2abadcd448 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 26 Oct 2023 12:41:57 +0330 Subject: [PATCH 3/3] update packages --- .../EasyMicroservices.Cores.AspCore.Tests.csproj | 8 ++++---- ...roservices.Cores.Relational.EntityFrameworkCore.csproj | 2 +- .../EasyMicroservices.Cores.Tests.csproj | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/EasyMicroservices.Cores.AspCore.Tests.csproj b/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/EasyMicroservices.Cores.AspCore.Tests.csproj index 3134651..6a4d47f 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/EasyMicroservices.Cores.AspCore.Tests.csproj +++ b/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/EasyMicroservices.Cores.AspCore.Tests.csproj @@ -9,9 +9,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -26,7 +26,7 @@ - 7.0.12 + 7.0.13 diff --git a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj index bbc6417..cf32eb6 100644 --- a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.Cores.Tests/EasyMicroservices.Cores.Tests.csproj b/src/CSharp/EasyMicroservices.Cores.Tests/EasyMicroservices.Cores.Tests.csproj index 4f96004..27e5bef 100644 --- a/src/CSharp/EasyMicroservices.Cores.Tests/EasyMicroservices.Cores.Tests.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Tests/EasyMicroservices.Cores.Tests.csproj @@ -9,18 +9,18 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - +