diff --git a/.github/workflows/chapter-4-contracts-workflow.yml b/.github/workflows/chapter-4-contracts-workflow.yml index 0dbf1608..f1d1b1a0 100644 --- a/.github/workflows/chapter-4-contracts-workflow.yml +++ b/.github/workflows/chapter-4-contracts-workflow.yml @@ -51,7 +51,7 @@ jobs: with: dotnet-version: 8.0.x - name: Add Evolutionary Architecture Nuget Source - uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@feature/nuget_config + uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main with: github-token: ${{ secrets.GITHUB_TOKEN }} owner: ${{ github.repository_owner }} diff --git a/.github/workflows/chapter-4-package-workflow.yml b/.github/workflows/chapter-4-package-workflow.yml index 73975a7b..2bb23db4 100644 --- a/.github/workflows/chapter-4-package-workflow.yml +++ b/.github/workflows/chapter-4-package-workflow.yml @@ -72,11 +72,12 @@ jobs: dotnet pack Fitnet.Common.IntegrationTestsToolbox/Fitnet.Common.IntegrationTestsToolbox.csproj -c Release dotnet pack Fitnet.Common.UnitTesting/Fitnet.Common.UnitTesting.csproj -c Release - - name: Prepare Packages - run: dotnet nuget add source --username $OWNER --password $GITHUB_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$OWNER/index.json" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OWNER: ${{ github.repository_owner }} + - name: Add Evolutionary Architecture Nuget Source + uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} + path: ${{ env.CHAPTER_DIR }} - name: Publish Packages run: | diff --git a/Chapter-3-microservice-extraction/Fitnet/Src/Fitnet/appsettings.json b/Chapter-3-microservice-extraction/Fitnet/Src/Fitnet/appsettings.json index 58996272..89456cd1 100644 --- a/Chapter-3-microservice-extraction/Fitnet/Src/Fitnet/appsettings.json +++ b/Chapter-3-microservice-extraction/Fitnet/Src/Fitnet/appsettings.json @@ -6,11 +6,16 @@ } }, "AllowedHosts": "*", - "FeatureManagement": { - "Contracts": true, - "Offers": true, - "Passes": true, - "Reports": true + "Modules": { + "Passes": { + "Enabled": true + }, + "Reports": { + "Enabled": true + }, + "Offers": { + "Enabled": true + } }, "ConnectionStrings": { "Passes": "", diff --git a/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json index 8df2a848..bb04efc0 100644 --- a/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-3-microservice-extraction/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json @@ -3,9 +3,6 @@ "Passes": { "Enabled": false }, - "Contracts": { - "Enabled": false - }, "Reports": { "Enabled": false }, diff --git a/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json index bd289507..a6213bbf 100644 --- a/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-3-microservice-extraction/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json @@ -3,9 +3,6 @@ "Passes": { "Enabled": true }, - "Contracts": { - "Enabled": false - }, "Reports": { "Enabled": false }, diff --git a/Chapter-3-microservice-extraction/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-3-microservice-extraction/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json index 902c091d..a23ee63c 100644 --- a/Chapter-3-microservice-extraction/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-3-microservice-extraction/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json @@ -3,9 +3,6 @@ "Passes": { "Enabled": true }, - "Contracts": { - "Enabled": false - }, "Reports": { "Enabled": true }, diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj index 7ff6b0cb..9394de56 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj @@ -2,8 +2,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj index a92cabed..dc212672 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj @@ -1,11 +1,11 @@ - + - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj index 76e8d52c..6311fa38 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj @@ -6,11 +6,11 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj index 1765bc7e..ea07f1c6 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj @@ -6,7 +6,7 @@ - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj index cbc5bed9..b28bf201 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj @@ -7,7 +7,7 @@ - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj index c353dad8..38c8ad32 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj @@ -4,6 +4,6 @@ 1.0.7 - + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj index 5a39d64e..b97c92e2 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/appsettings.IntegrationTests.json index d17b926e..38bea278 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/appsettings.IntegrationTests.json @@ -1,8 +1,16 @@ { - "FeatureManagement": { - "Contracts": true, - "Offers": false, - "Passes": false, - "Reports": false + "Modules": { + "Passes": { + "Enabled": false + }, + "Contracts": { + "Enabled": true + }, + "Reports": { + "Enabled": false + }, + "Offers": { + "Enabled": false + } } } \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj index 706d105c..2135b55d 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj @@ -5,7 +5,7 @@ - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/GlobalUsings.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/GlobalUsings.cs index 673309a0..5db5d030 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/GlobalUsings.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/GlobalUsings.cs @@ -1,4 +1,3 @@ // Global using directives global using JetBrains.Annotations; -global using Microsoft.FeatureManagement; \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Program.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Program.cs index 7b27d9c8..a39a6ebe 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Program.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Program.cs @@ -8,7 +8,6 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddSingleton(TimeProvider.System); -builder.Services.AddFeatureManagement(); builder.Services.AddClock(); builder.Services.AddContractsApi(builder.Configuration); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/appsettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/appsettings.json index 37b231db..90e61cbc 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/appsettings.json +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/appsettings.json @@ -6,9 +6,6 @@ } }, "AllowedHosts": "*", - "FeatureManagement": { - "Contracts": true, - }, "ConnectionStrings": { "Contracts": "" }, @@ -17,4 +14,4 @@ "Username": "guest", "Password": "guest" } -} +} \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj index 1dc3e557..d5582adc 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj @@ -6,7 +6,7 @@ - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/GlobalUsings.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/GlobalUsings.cs index 673309a0..5db5d030 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/GlobalUsings.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/GlobalUsings.cs @@ -1,4 +1,3 @@ // Global using directives global using JetBrains.Annotations; -global using Microsoft.FeatureManagement; \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Program.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Program.cs index 04c32e41..7b12a1ce 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Program.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Program.cs @@ -11,12 +11,11 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); -builder.Services.AddFeatureManagement(); builder.Services.AddClock(); builder.Services.AddPasses(builder.Configuration, Module.Passes); builder.Services.AddOffers(builder.Configuration, Module.Offers); -builder.Services.AddReports(Module.Reports); +builder.Services.AddReports(builder.Configuration, Module.Reports); var app = builder.Build(); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/appsettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/appsettings.json index 58996272..89456cd1 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/appsettings.json +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/appsettings.json @@ -6,11 +6,16 @@ } }, "AllowedHosts": "*", - "FeatureManagement": { - "Contracts": true, - "Offers": true, - "Passes": true, - "Reports": true + "Modules": { + "Passes": { + "Enabled": true + }, + "Reports": { + "Enabled": true + }, + "Offers": { + "Enabled": true + } }, "ConnectionStrings": { "Passes": "", diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj index c50b7d99..3a31b49d 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj @@ -14,7 +14,7 @@ - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/OffersModule.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/OffersModule.cs index 73d24994..856996ec 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/OffersModule.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/OffersModule.cs @@ -1,9 +1,9 @@ namespace EvolutionaryArchitecture.Fitnet.Offers.Api; -using Common.Infrastructure.Modules; using DataAccess; using Common.Infrastructure.Mediator; using System.Reflection; +using Common.Infrastructure.Modules; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -12,7 +12,7 @@ public static class OffersModule { public static void RegisterOffers(this WebApplication app, string module) { - if (!app.IsModuleEnabled(module)) + if (!app.Configuration.IsModuleEnabled(module)) { return; } @@ -23,7 +23,7 @@ public static void RegisterOffers(this WebApplication app, string module) public static IServiceCollection AddOffers(this IServiceCollection services, IConfiguration configuration, string module) { - if (!services.IsModuleEnabled(module)) + if (!configuration.IsModuleEnabled(module)) { return services; } diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj index 36f5d128..ea536fc7 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj @@ -1,7 +1,7 @@ - - + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj index 0198fdae..ba0577cb 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json index 4f6c96ee..bb04efc0 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/appsettings.IntegrationTests.json @@ -1,8 +1,13 @@ { - "FeatureManagement": { - "Contracts": false, - "Offers": true, - "Passes": false, - "Reports": false + "Modules": { + "Passes": { + "Enabled": false + }, + "Reports": { + "Enabled": false + }, + "Offers": { + "Enabled": true + } } } \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj index cd5b4d8c..ea074bff 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj @@ -15,11 +15,11 @@ - - + + - - - + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/PassesModule.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/PassesModule.cs index 0fe7b787..4f540b17 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/PassesModule.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/PassesModule.cs @@ -13,7 +13,7 @@ public static class PassesModule { public static void RegisterPasses(this WebApplication app, string module) { - if (!app.IsModuleEnabled(module)) + if (!app.Configuration.IsModuleEnabled(module)) { return; } @@ -25,7 +25,7 @@ public static void RegisterPasses(this WebApplication app, string module) public static IServiceCollection AddPasses(this IServiceCollection services, IConfiguration configuration, string module) { - if (!services.IsModuleEnabled(module)) + if (!configuration.IsModuleEnabled(module)) { return services; } diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj index ac774634..3790ab1a 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj @@ -1,8 +1,8 @@ - + - - + + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj index 3faa49f6..1605338f 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj @@ -1,8 +1,8 @@ - + - + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj index 386b9019..880840b9 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj @@ -5,10 +5,10 @@ - - + + - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json index 514ed1ef..a6213bbf 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/appsettings.IntegrationTests.json @@ -1,8 +1,13 @@ { - "FeatureManagement": { - "Contracts": false, - "Offers": false, - "Passes": true, - "Reports": false + "Modules": { + "Passes": { + "Enabled": true + }, + "Reports": { + "Enabled": false + }, + "Offers": { + "Enabled": false + } } } \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj index 5a49c905..aa3b6449 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj @@ -3,12 +3,12 @@ - - - - - - + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/ReportsModule.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/ReportsModule.cs index 7e0d9cf2..fdff6959 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/ReportsModule.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/ReportsModule.cs @@ -5,12 +5,13 @@ namespace EvolutionaryArchitecture.Fitnet.Reports; using Microsoft.Extensions.DependencyInjection; using DataAccess; using GenerateNewPassesRegistrationsPerMonthReport; +using Microsoft.Extensions.Configuration; public static class ReportsModule { public static void RegisterReports(this WebApplication app, string module) { - if (!app.IsModuleEnabled(module)) + if (!app.Configuration.IsModuleEnabled(module)) { return; } @@ -19,9 +20,10 @@ public static void RegisterReports(this WebApplication app, string module) app.MapReports(); } - public static IServiceCollection AddReports(this IServiceCollection services, string module) + public static IServiceCollection AddReports(this IServiceCollection services, IConfiguration configuration, + string module) { - if (!services.IsModuleEnabled(module)) + if (!configuration.IsModuleEnabled(module)) { return services; } diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj index ce8d1a87..50e90028 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj @@ -5,9 +5,9 @@ - + - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json index cd19122a..a23ee63c 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/appsettings.IntegrationTests.json @@ -1,9 +1,14 @@ { - "FeatureManagement": { - "Contracts": false, - "Offers": false, - "Passes": true, - "Reports": true + "Modules": { + "Passes": { + "Enabled": true + }, + "Reports": { + "Enabled": true + }, + "Offers": { + "Enabled": false + } }, "RabbitMq": {