From 8a8f8a87d0a82184859fa860576aa7dcbb5f071c Mon Sep 17 00:00:00 2001 From: Lucian Ghinet Date: Fri, 24 Nov 2023 14:44:46 +0200 Subject: [PATCH 01/11] v1 --- .../MicroServices/NBB.Contracts/NBB.Contracts.Api/Dockerfile | 4 ++-- .../NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj | 2 +- .../NBB.Contracts.Application.csproj | 2 +- .../NBB.Contracts.Domain/NBB.Contracts.Domain.csproj | 2 +- .../NBB.Contracts.Migrations/NBB.Contracts.Migrations.csproj | 2 +- .../NBB.Contracts.PublishedLanguage.csproj | 2 +- .../NBB.Contracts.ReadModel.Data.csproj | 2 +- .../NBB.Contracts.ReadModel/NBB.Contracts.ReadModel.csproj | 2 +- .../NBB.Contracts/NBB.Contracts.Worker/Dockerfile | 4 ++-- .../NBB.Contracts.Worker/NBB.Contracts.Worker.csproj | 2 +- .../NBB.Contracts.WriteModel.Data.csproj | 2 +- .../NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj | 2 +- .../NBB.Invoices.FSharp.Worker.fsproj | 2 +- .../NBB.Invoices.FSharp/NBB.Invoices.FSharp.fsproj | 2 +- .../NBB.Invoices/NBB.Invoices.Api/NBB.Invoices.Api.csproj | 2 +- .../NBB.Invoices.Application/NBB.Invoices.Application.csproj | 2 +- .../NBB.Invoices/NBB.Invoices.Data/NBB.Invoices.Data.csproj | 2 +- .../NBB.Invoices.Domain/NBB.Invoices.Domain.csproj | 2 +- .../NBB.Invoices.Migrations/NBB.Invoices.Migrations.csproj | 2 +- .../NBB.Invoices.PublishedLanguage.csproj | 2 +- .../NBB.Invoices.Worker/NBB.Invoices.Worker.csproj | 2 +- .../NBB.MicroServicesOrchestration.csproj | 2 +- .../NBB.Payments/NBB.Payments.Api/NBB.Payments.Api.csproj | 2 +- .../NBB.Payments.Application/NBB.Payments.Application.csproj | 2 +- .../NBB.Payments/NBB.Payments.Data/NBB.Payments.Data.csproj | 2 +- .../NBB.Payments.Domain/NBB.Payments.Domain.csproj | 2 +- .../NBB.Payments.Migrations/NBB.Payments.Migrations.csproj | 2 +- .../NBB.Payments.PublishedLanguage.csproj | 2 +- .../NBB.Payments.Worker/NBB.Payments.Worker.csproj | 2 +- .../Monolith/NBB.Mono.Migrations/NBB.Mono.Migrations.csproj | 2 +- samples/Monolith/NBB.Mono/NBB.Mono.csproj | 2 +- samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj | 2 +- samples/MultiTenancy/NBB.Todo.Data/NBB.Todo.Data.csproj | 2 +- .../NBB.Todo.Migrations/NBB.Todo.Migrations.csproj | 2 +- .../NBB.Todo.PublishedLanguage.csproj | 2 +- samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj | 2 +- .../ProcessManagerSample/ProcessManagerSample.csproj | 2 +- .../NBB.Application.DataContracts.Schema.csproj | 2 +- .../NBB.Application.DataContracts.csproj | 2 +- src/Application/NBB.Application.DataContracts/Readme.md | 2 +- .../NBB.Application.MediatR.Effects.csproj | 2 +- .../NBB.Application.MediatR/NBB.Application.MediatR.csproj | 2 +- .../NBB.Application.Mediator.FSharp.fsproj | 2 +- src/Core/NBB.Core.Abstractions/NBB.Core.Abstractions.csproj | 2 +- src/Core/NBB.Core.Configuration/NBB.Core.Configuration.csproj | 2 +- .../NBB.Core.DependencyInjection.csproj | 2 +- .../NBB.Core.Effects.FSharp/NBB.Core.Effects.FSharp.fsproj | 2 +- src/Core/NBB.Core.Effects/NBB.Core.Effects.csproj | 2 +- .../NBB.Core.Evented.FSharp/NBB.Core.Evented.FSharp.fsproj | 2 +- src/Core/NBB.Core.FSharp/NBB.Core.FSharp.fsproj | 2 +- src/Core/NBB.Core.Pipeline/NBB.Core.Pipeline.csproj | 2 +- .../NBB.Correlation.AspNet/NBB.Correlation.AspNet.csproj | 2 +- .../NBB.Correlation.Serilog.SqlServer.csproj | 2 +- .../NBB.Correlation.Serilog/NBB.Correlation.Serilog.csproj | 2 +- src/Correlation/NBB.Correlation/NBB.Correlation.csproj | 2 +- src/Data/NBB.Data.Abstractions/NBB.Data.Abstractions.csproj | 2 +- .../NBB.Data.EntityFramework.MultiTenancy.csproj | 2 +- .../NBB.Data.EntityFramework/NBB.Data.EntityFramework.csproj | 2 +- src/Data/NBB.Data.EventSourcing/NBB.Data.EventSourcing.csproj | 2 +- .../NBB.Domain.Abstractions/NBB.Domain.Abstractions.csproj | 2 +- src/Domain/NBB.Domain/NBB.Domain.csproj | 2 +- .../NBB.EventStore.Abstractions.csproj | 2 +- .../NBB.EventStore.AdoNet.Migrations.csproj | 2 +- .../NBB.EventStore.AdoNet.MultiTenancy.csproj | 2 +- .../NBB.EventStore.AdoNet/NBB.EventStore.AdoNet.csproj | 2 +- .../NBB.EventStore.Effects/NBB.EventStore.Effects.csproj | 2 +- .../NBB.EventStore.InMemory/NBB.EventStore.InMemory.csproj | 2 +- src/EventStore/NBB.EventStore/NBB.EventStore.csproj | 2 +- .../NBB.SQLStreamStore.Migrations.csproj | 2 +- src/EventStore/NBB.SQLStreamStore/NBB.SQLStreamStore.csproj | 2 +- src/Http/NBB.Http.Effects/NBB.Http.Effects.csproj | 2 +- .../NBB.Messaging.Abstractions.csproj | 2 +- .../NBB.Messaging.BackwardCompatibility.csproj | 2 +- .../NBB.Messaging.DataContracts.csproj | 2 +- .../NBB.Messaging.Effects/NBB.Messaging.Effects.csproj | 2 +- src/Messaging/NBB.Messaging.Host/NBB.Messaging.Host.csproj | 2 +- .../NBB.Messaging.InProcessMessaging.csproj | 2 +- .../NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj | 2 +- .../NBB.Messaging.MultiTenancy.csproj | 2 +- src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj | 2 +- src/Messaging/NBB.Messaging.Noop/NBB.Messaging.Noop.csproj | 2 +- .../NBB.Messaging.OpenTelemetry.csproj | 2 +- src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj | 2 +- .../NBB.MultiTenancy.Abstractions.csproj | 2 +- .../NBB.MultiTenancy.AspNet/NBB.MultiTenancy.AspNet.csproj | 2 +- .../NBB.MultiTenancy.Identification.Http.csproj | 2 +- .../NBB.MultiTenancy.Identification.Messaging.csproj | 2 +- .../NBB.MultiTenancy.Identification.csproj | 2 +- .../NBB.ProcessManager.Definition.csproj | 2 +- .../NBB.ProcessManager.Runtime.csproj | 2 +- src/Projections/NBB.ProjectR/NBB.ProjectR.csproj | 2 +- .../NBB.Tools.Serilog.Enrichers.ServiceIdentifier.csproj | 2 +- .../NBB.Tools.Serilog.Enrichers.TenantId.csproj | 2 +- .../NBB.Tools.Serilog.OpenTelemetryTracingSink.csproj | 2 +- .../EffectsBenchmarks/EffectsBenchmarks.fsproj | 2 +- .../EventStoreBenchmarks/EventStoreBenchmarks.csproj | 2 +- .../NBB.EventStore.IntegrationTests.csproj | 2 +- .../NBB.Messaging.Rusi.IntegrationTests.csproj | 2 +- .../NBB.Application.Effects.Tests.csproj | 2 +- .../NBB.Application.Mediator.FSharp.Tests.fsproj | 2 +- .../NBB.Core.Configuration.Tests.csproj | 2 +- .../NBB.Core.Effects.FSharp.Tests.fsproj | 2 +- .../Core/NBB.Core.Effects.Tests/NBB.Core.Effects.Tests.csproj | 2 +- .../NBB.Core.Evented.FSharp.Tests.fsproj | 2 +- .../NBB.Core.Pipeline.Tests/NBB.Core.Pipeline.Tests.csproj | 2 +- .../NBB.Data.EntityFramework.MultiTenancy.Tests.csproj | 2 +- .../NBB.Data.EntityFramework.Tests.csproj | 2 +- .../NBB.Data.EventSourcing.Tests.csproj | 2 +- .../UnitTests/Domain/NBB.Domain.Tests/NBB.Domain.Tests.csproj | 2 +- .../NBB.EventStore.AdoNet.Tests.csproj | 2 +- .../NBB.EventStore.InMemory.Tests.csproj | 2 +- .../NBB.EventStore.Tests/NBB.EventStore.Tests.csproj | 2 +- .../Http/NBB.Http.Effects.Tests/NBB.Http.Effects.Tests.csproj | 2 +- .../NBB.Messaging.Abstractions.Tests.csproj | 2 +- .../NBB.Messaging.DataContracts.Tests.csproj | 2 +- .../NBB.Messaging.Effects.Tests.csproj | 2 +- .../NBB.Messaging.Host.Tests/NBB.Messaging.Host.Tests.csproj | 2 +- .../NBB.Messaging.InProcessMessaging.Tests.csproj | 2 +- .../NBB.Messaging.MultiTenancy.Tests.csproj | 2 +- .../NBB.Messaging.Rusi.Tests/NBB.Messaging.Rusi.Tests.csproj | 2 +- .../NBB.MultiTenancy.Abstractions.Tests.csproj | 2 +- .../NBB.MultiTenancy.Identification.Http.Tests.csproj | 2 +- .../NBB.MultiTenancy.Identification.Messaging.Tests.csproj | 2 +- .../NBB.MultiTenancy.Identification.Tests.csproj | 2 +- .../NBB.Core.FSharp.Tests/NBB.Core.FSharp.Tests.fsproj | 2 +- .../NBB.ProcessManager.Tests/NBB.ProcessManager.Tests.csproj | 2 +- .../Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj | 2 +- ...NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests.csproj | 2 +- .../NBB.Tools.Serilog.Enrichers.TenantId.Tests.csproj | 2 +- 129 files changed, 131 insertions(+), 131 deletions(-) diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Dockerfile b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Dockerfile index 17d1fa3b..12631dc7 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Dockerfile +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Dockerfile @@ -1,6 +1,6 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf @@ -8,7 +8,7 @@ RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /usr/lib/ssl/openssl.cnf EXPOSE 80 -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["NuGet.config", "."] COPY ["dependencies.props", "."] diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj index 8b70415f..932fc344 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 ..\..\..\..\docker-compose.dcproj NBB_Contracts_6a73f87d-2175-4be0-9a42-31cb73bc8e10 Linux diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/NBB.Contracts.Application.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/NBB.Contracts.Application.csproj index 920daf06..0ed36ed8 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/NBB.Contracts.Application.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/NBB.Contracts.Application.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Domain/NBB.Contracts.Domain.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Domain/NBB.Contracts.Domain.csproj index 7d6ac305..ac404c5c 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Domain/NBB.Contracts.Domain.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Domain/NBB.Contracts.Domain.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Migrations/NBB.Contracts.Migrations.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Migrations/NBB.Contracts.Migrations.csproj index 8ca0cadc..4bb35710 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Migrations/NBB.Contracts.Migrations.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Migrations/NBB.Contracts.Migrations.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Contracts_6a73f87d-2175-4be0-9a42-31cb73bc8e10 diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.PublishedLanguage/NBB.Contracts.PublishedLanguage.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.PublishedLanguage/NBB.Contracts.PublishedLanguage.csproj index d5cbdaf6..ef5f4f84 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.PublishedLanguage/NBB.Contracts.PublishedLanguage.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.PublishedLanguage/NBB.Contracts.PublishedLanguage.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel.Data/NBB.Contracts.ReadModel.Data.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel.Data/NBB.Contracts.ReadModel.Data.csproj index 7961f9fa..93dd6a6a 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel.Data/NBB.Contracts.ReadModel.Data.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel.Data/NBB.Contracts.ReadModel.Data.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel/NBB.Contracts.ReadModel.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel/NBB.Contracts.ReadModel.csproj index 1ae781cb..5856dd07 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel/NBB.Contracts.ReadModel.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.ReadModel/NBB.Contracts.ReadModel.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Dockerfile b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Dockerfile index b1758e7f..3355bb83 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Dockerfile +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Dockerfile @@ -1,6 +1,6 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf @@ -8,7 +8,7 @@ RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /usr/lib/ssl/openssl.cnf -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["NuGet.config", "."] COPY ["dependencies.props", "."] diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj index 12dd8bfe..9c1499f6 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Contracts_6a73f87d-2175-4be0-9a42-31cb73bc8e10 Linux ..\..\..\.. diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.WriteModel.Data/NBB.Contracts.WriteModel.Data.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.WriteModel.Data/NBB.Contracts.WriteModel.Data.csproj index ee71d13f..aca85be8 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.WriteModel.Data/NBB.Contracts.WriteModel.Data.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.WriteModel.Data/NBB.Contracts.WriteModel.Data.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj index 94a6b2a5..4ba43e65 100644 --- a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj +++ b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 NBB_Invoices_c9e28d3a-7681-452a-9dbe-a52a9b6a0900 diff --git a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Worker/NBB.Invoices.FSharp.Worker.fsproj b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Worker/NBB.Invoices.FSharp.Worker.fsproj index 9d9dfa06..255fc07e 100644 --- a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Worker/NBB.Invoices.FSharp.Worker.fsproj +++ b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Worker/NBB.Invoices.FSharp.Worker.fsproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 NBB_Invoices_c9e28d3a-7681-452a-9dbe-a52a9b6a0900 diff --git a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp/NBB.Invoices.FSharp.fsproj b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp/NBB.Invoices.FSharp.fsproj index d2d627be..bec85e8a 100644 --- a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp/NBB.Invoices.FSharp.fsproj +++ b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp/NBB.Invoices.FSharp.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Api/NBB.Invoices.Api.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Api/NBB.Invoices.Api.csproj index a904bac8..f7868337 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Api/NBB.Invoices.Api.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Api/NBB.Invoices.Api.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 ..\docker-compose.dcproj NBB_Invoices_c9e28d3a-7681-452a-9dbe-a52a9b6a0900 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/NBB.Invoices.Application.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/NBB.Invoices.Application.csproj index d4bce7e1..c6f1ae2e 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/NBB.Invoices.Application.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/NBB.Invoices.Application.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Data/NBB.Invoices.Data.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Data/NBB.Invoices.Data.csproj index b93f6a77..b7d409a9 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Data/NBB.Invoices.Data.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Data/NBB.Invoices.Data.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Domain/NBB.Invoices.Domain.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Domain/NBB.Invoices.Domain.csproj index 6e372600..abaee232 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Domain/NBB.Invoices.Domain.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Domain/NBB.Invoices.Domain.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Migrations/NBB.Invoices.Migrations.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Migrations/NBB.Invoices.Migrations.csproj index 14ab5687..df6625d3 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Migrations/NBB.Invoices.Migrations.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Migrations/NBB.Invoices.Migrations.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Invoices_c9e28d3a-7681-452a-9dbe-a52a9b6a0900 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.PublishedLanguage/NBB.Invoices.PublishedLanguage.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.PublishedLanguage/NBB.Invoices.PublishedLanguage.csproj index d5cbdaf6..ef5f4f84 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.PublishedLanguage/NBB.Invoices.PublishedLanguage.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.PublishedLanguage/NBB.Invoices.PublishedLanguage.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj index 32929f3f..2b8304f2 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Invoices_c9e28d3a-7681-452a-9dbe-a52a9b6a0900 diff --git a/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj b/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj index 30a70f50..4b7af13f 100644 --- a/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj +++ b/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 NBB_Orchestration_a3e28d3a-7681-452a-9dbe-a52a9b6a0854 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Api/NBB.Payments.Api.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Api/NBB.Payments.Api.csproj index df76468e..3b48040f 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Api/NBB.Payments.Api.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Api/NBB.Payments.Api.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 ..\..\..\..\docker-compose.dcproj NBB_Payments_65e4fd90-1fb9-4806-9e38-5d70466ad364 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Application/NBB.Payments.Application.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Application/NBB.Payments.Application.csproj index 8cc5ed4c..7cb0401e 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Application/NBB.Payments.Application.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Application/NBB.Payments.Application.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Data/NBB.Payments.Data.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Data/NBB.Payments.Data.csproj index a8e125f4..f41a397f 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Data/NBB.Payments.Data.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Data/NBB.Payments.Data.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Domain/NBB.Payments.Domain.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Domain/NBB.Payments.Domain.csproj index 4b8f08da..2d171357 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Domain/NBB.Payments.Domain.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Domain/NBB.Payments.Domain.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Migrations/NBB.Payments.Migrations.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Migrations/NBB.Payments.Migrations.csproj index edb6cb41..afd3a003 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Migrations/NBB.Payments.Migrations.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Migrations/NBB.Payments.Migrations.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Payments_65e4fd90-1fb9-4806-9e38-5d70466ad364 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.PublishedLanguage/NBB.Payments.PublishedLanguage.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.PublishedLanguage/NBB.Payments.PublishedLanguage.csproj index 9140a4e6..89f7549e 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.PublishedLanguage/NBB.Payments.PublishedLanguage.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.PublishedLanguage/NBB.Payments.PublishedLanguage.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj index 2be5f8e2..3cc506cc 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Payments_65e4fd90-1fb9-4806-9e38-5d70466ad364 diff --git a/samples/Monolith/NBB.Mono.Migrations/NBB.Mono.Migrations.csproj b/samples/Monolith/NBB.Mono.Migrations/NBB.Mono.Migrations.csproj index 47f7aa0b..a766b6b7 100644 --- a/samples/Monolith/NBB.Mono.Migrations/NBB.Mono.Migrations.csproj +++ b/samples/Monolith/NBB.Mono.Migrations/NBB.Mono.Migrations.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_Mono_04f3de64-51a9-466b-a489-ed331aba59c8 diff --git a/samples/Monolith/NBB.Mono/NBB.Mono.csproj b/samples/Monolith/NBB.Mono/NBB.Mono.csproj index 0775678b..1cd296e6 100644 --- a/samples/Monolith/NBB.Mono/NBB.Mono.csproj +++ b/samples/Monolith/NBB.Mono/NBB.Mono.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 ..\..\MicroServices\docker-compose.dcproj NBB_Mono_04f3de64-51a9-466b-a489-ed331aba59c8 diff --git a/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj b/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj index 4d4374fe..69854882 100644 --- a/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj +++ b/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 NBB_Todo_a9328d3a-7681-452a-9dbe-a52a9b6a0593 diff --git a/samples/MultiTenancy/NBB.Todo.Data/NBB.Todo.Data.csproj b/samples/MultiTenancy/NBB.Todo.Data/NBB.Todo.Data.csproj index fc6a2d6a..c83f2b53 100644 --- a/samples/MultiTenancy/NBB.Todo.Data/NBB.Todo.Data.csproj +++ b/samples/MultiTenancy/NBB.Todo.Data/NBB.Todo.Data.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/samples/MultiTenancy/NBB.Todo.Migrations/NBB.Todo.Migrations.csproj b/samples/MultiTenancy/NBB.Todo.Migrations/NBB.Todo.Migrations.csproj index 104613f6..f190a4af 100644 --- a/samples/MultiTenancy/NBB.Todo.Migrations/NBB.Todo.Migrations.csproj +++ b/samples/MultiTenancy/NBB.Todo.Migrations/NBB.Todo.Migrations.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 NBB_Todo_a9328d3a-7681-452a-9dbe-a52a9b6a0593 diff --git a/samples/MultiTenancy/NBB.Todo.PublishedLanguage/NBB.Todo.PublishedLanguage.csproj b/samples/MultiTenancy/NBB.Todo.PublishedLanguage/NBB.Todo.PublishedLanguage.csproj index d0fe7055..dc93ab67 100644 --- a/samples/MultiTenancy/NBB.Todo.PublishedLanguage/NBB.Todo.PublishedLanguage.csproj +++ b/samples/MultiTenancy/NBB.Todo.PublishedLanguage/NBB.Todo.PublishedLanguage.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj b/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj index 52600b6f..1eb1482a 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj +++ b/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj @@ -2,7 +2,7 @@ - net7.0 + net8.0 Linux NBB_Todo_a9328d3a-7681-452a-9dbe-a52a9b6a0593 Exe diff --git a/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj b/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj index 1565d354..c63952ab 100644 --- a/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj +++ b/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 NBB_ProcessManager_6573f87d-2175-4be0-9a42-31cb73bc8e19 diff --git a/src/Application/NBB.Application.DataContracts.Schema/NBB.Application.DataContracts.Schema.csproj b/src/Application/NBB.Application.DataContracts.Schema/NBB.Application.DataContracts.Schema.csproj index 413ae74b..9df9636c 100644 --- a/src/Application/NBB.Application.DataContracts.Schema/NBB.Application.DataContracts.Schema.csproj +++ b/src/Application/NBB.Application.DataContracts.Schema/NBB.Application.DataContracts.Schema.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Data contracts for CQ(R)S applications. diff --git a/src/Application/NBB.Application.DataContracts/NBB.Application.DataContracts.csproj b/src/Application/NBB.Application.DataContracts/NBB.Application.DataContracts.csproj index d610bbb0..89b31e12 100644 --- a/src/Application/NBB.Application.DataContracts/NBB.Application.DataContracts.csproj +++ b/src/Application/NBB.Application.DataContracts/NBB.Application.DataContracts.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Legacy code for compatibiltity with NBB 4.x. Reference this package only to support published language assemblies compiled against NBB 4 diff --git a/src/Application/NBB.Application.DataContracts/Readme.md b/src/Application/NBB.Application.DataContracts/Readme.md index f2a899be..f751c517 100644 --- a/src/Application/NBB.Application.DataContracts/Readme.md +++ b/src/Application/NBB.Application.DataContracts/Readme.md @@ -35,7 +35,7 @@ namespace ServiceA.PublishedLanguage.Commands - net7.0 + net8.0 diff --git a/src/Application/NBB.Application.MediatR.Effects/NBB.Application.MediatR.Effects.csproj b/src/Application/NBB.Application.MediatR.Effects/NBB.Application.MediatR.Effects.csproj index edc58b1c..374c2f39 100644 --- a/src/Application/NBB.Application.MediatR.Effects/NBB.Application.MediatR.Effects.csproj +++ b/src/Application/NBB.Application.MediatR.Effects/NBB.Application.MediatR.Effects.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Application/NBB.Application.MediatR/NBB.Application.MediatR.csproj b/src/Application/NBB.Application.MediatR/NBB.Application.MediatR.csproj index 1039bbb4..4ca33e3b 100644 --- a/src/Application/NBB.Application.MediatR/NBB.Application.MediatR.csproj +++ b/src/Application/NBB.Application.MediatR/NBB.Application.MediatR.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Data contracts for CQ(R)S applications. diff --git a/src/Application/NBB.Application.Mediator.FSharp/NBB.Application.Mediator.FSharp.fsproj b/src/Application/NBB.Application.Mediator.FSharp/NBB.Application.Mediator.FSharp.fsproj index 65cd1e9c..fe623413 100644 --- a/src/Application/NBB.Application.Mediator.FSharp/NBB.Application.Mediator.FSharp.fsproj +++ b/src/Application/NBB.Application.Mediator.FSharp/NBB.Application.Mediator.FSharp.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Core/NBB.Core.Abstractions/NBB.Core.Abstractions.csproj b/src/Core/NBB.Core.Abstractions/NBB.Core.Abstractions.csproj index 63c12fe8..4527560e 100644 --- a/src/Core/NBB.Core.Abstractions/NBB.Core.Abstractions.csproj +++ b/src/Core/NBB.Core.Abstractions/NBB.Core.Abstractions.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 This package provides cross-cutting abstractions and type extensions that other packages rely upon. The interfaces of this package are not intended to be directly referenced by the end-consumer. diff --git a/src/Core/NBB.Core.Configuration/NBB.Core.Configuration.csproj b/src/Core/NBB.Core.Configuration/NBB.Core.Configuration.csproj index 17625586..fb52b521 100644 --- a/src/Core/NBB.Core.Configuration/NBB.Core.Configuration.csproj +++ b/src/Core/NBB.Core.Configuration/NBB.Core.Configuration.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable diff --git a/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj b/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj index 17a9e042..545685ff 100644 --- a/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj +++ b/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 Asp.Net DI and Scrutor missing features diff --git a/src/Core/NBB.Core.Effects.FSharp/NBB.Core.Effects.FSharp.fsproj b/src/Core/NBB.Core.Effects.FSharp/NBB.Core.Effects.FSharp.fsproj index 589396eb..f5cfe525 100644 --- a/src/Core/NBB.Core.Effects.FSharp/NBB.Core.Effects.FSharp.fsproj +++ b/src/Core/NBB.Core.Effects.FSharp/NBB.Core.Effects.FSharp.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Core/NBB.Core.Effects/NBB.Core.Effects.csproj b/src/Core/NBB.Core.Effects/NBB.Core.Effects.csproj index 20ff79e3..94488dc6 100644 --- a/src/Core/NBB.Core.Effects/NBB.Core.Effects.csproj +++ b/src/Core/NBB.Core.Effects/NBB.Core.Effects.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Core/NBB.Core.Evented.FSharp/NBB.Core.Evented.FSharp.fsproj b/src/Core/NBB.Core.Evented.FSharp/NBB.Core.Evented.FSharp.fsproj index 582dc146..c93ca17a 100644 --- a/src/Core/NBB.Core.Evented.FSharp/NBB.Core.Evented.FSharp.fsproj +++ b/src/Core/NBB.Core.Evented.FSharp/NBB.Core.Evented.FSharp.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Core/NBB.Core.FSharp/NBB.Core.FSharp.fsproj b/src/Core/NBB.Core.FSharp/NBB.Core.FSharp.fsproj index 4cdaf51a..73a4f06a 100644 --- a/src/Core/NBB.Core.FSharp/NBB.Core.FSharp.fsproj +++ b/src/Core/NBB.Core.FSharp/NBB.Core.FSharp.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Core/NBB.Core.Pipeline/NBB.Core.Pipeline.csproj b/src/Core/NBB.Core.Pipeline/NBB.Core.Pipeline.csproj index 38baae60..76ae7df4 100644 --- a/src/Core/NBB.Core.Pipeline/NBB.Core.Pipeline.csproj +++ b/src/Core/NBB.Core.Pipeline/NBB.Core.Pipeline.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 Generic pipeline diff --git a/src/Correlation/NBB.Correlation.AspNet/NBB.Correlation.AspNet.csproj b/src/Correlation/NBB.Correlation.AspNet/NBB.Correlation.AspNet.csproj index 3b8ea991..68a28109 100644 --- a/src/Correlation/NBB.Correlation.AspNet/NBB.Correlation.AspNet.csproj +++ b/src/Correlation/NBB.Correlation.AspNet/NBB.Correlation.AspNet.csproj @@ -7,7 +7,7 @@ - net7.0 + net8.0 Correlation middleware for Asp.Net Core diff --git a/src/Correlation/NBB.Correlation.Serilog.SqlServer/NBB.Correlation.Serilog.SqlServer.csproj b/src/Correlation/NBB.Correlation.Serilog.SqlServer/NBB.Correlation.Serilog.SqlServer.csproj index d02d54fa..34ef0a20 100644 --- a/src/Correlation/NBB.Correlation.Serilog.SqlServer/NBB.Correlation.Serilog.SqlServer.csproj +++ b/src/Correlation/NBB.Correlation.Serilog.SqlServer/NBB.Correlation.Serilog.SqlServer.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Extensions for creating new columns in sql Server for Serilog Table diff --git a/src/Correlation/NBB.Correlation.Serilog/NBB.Correlation.Serilog.csproj b/src/Correlation/NBB.Correlation.Serilog/NBB.Correlation.Serilog.csproj index 31abe823..a6530f2a 100644 --- a/src/Correlation/NBB.Correlation.Serilog/NBB.Correlation.Serilog.csproj +++ b/src/Correlation/NBB.Correlation.Serilog/NBB.Correlation.Serilog.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Serilog enrichers for Correlation package diff --git a/src/Correlation/NBB.Correlation/NBB.Correlation.csproj b/src/Correlation/NBB.Correlation/NBB.Correlation.csproj index 571de58e..cf13924c 100644 --- a/src/Correlation/NBB.Correlation/NBB.Correlation.csproj +++ b/src/Correlation/NBB.Correlation/NBB.Correlation.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Correlation infrastructure for distributed systems diff --git a/src/Data/NBB.Data.Abstractions/NBB.Data.Abstractions.csproj b/src/Data/NBB.Data.Abstractions/NBB.Data.Abstractions.csproj index a657b9b1..8e7cfa69 100644 --- a/src/Data/NBB.Data.Abstractions/NBB.Data.Abstractions.csproj +++ b/src/Data/NBB.Data.Abstractions/NBB.Data.Abstractions.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 This package contains some lightweight data access abstractions diff --git a/src/Data/NBB.Data.EntityFramework.MultiTenancy/NBB.Data.EntityFramework.MultiTenancy.csproj b/src/Data/NBB.Data.EntityFramework.MultiTenancy/NBB.Data.EntityFramework.MultiTenancy.csproj index aef478ea..baa78267 100644 --- a/src/Data/NBB.Data.EntityFramework.MultiTenancy/NBB.Data.EntityFramework.MultiTenancy.csproj +++ b/src/Data/NBB.Data.EntityFramework.MultiTenancy/NBB.Data.EntityFramework.MultiTenancy.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Data/NBB.Data.EntityFramework/NBB.Data.EntityFramework.csproj b/src/Data/NBB.Data.EntityFramework/NBB.Data.EntityFramework.csproj index 09959794..2b2621cc 100644 --- a/src/Data/NBB.Data.EntityFramework/NBB.Data.EntityFramework.csproj +++ b/src/Data/NBB.Data.EntityFramework/NBB.Data.EntityFramework.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 An Entity Framework data access for general use. diff --git a/src/Data/NBB.Data.EventSourcing/NBB.Data.EventSourcing.csproj b/src/Data/NBB.Data.EventSourcing/NBB.Data.EventSourcing.csproj index bde7edd5..79b7e909 100644 --- a/src/Data/NBB.Data.EventSourcing/NBB.Data.EventSourcing.csproj +++ b/src/Data/NBB.Data.EventSourcing/NBB.Data.EventSourcing.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Contains data access building blocks for event-sourced aggregates. diff --git a/src/Domain/NBB.Domain.Abstractions/NBB.Domain.Abstractions.csproj b/src/Domain/NBB.Domain.Abstractions/NBB.Domain.Abstractions.csproj index e312cbe6..08e6cf16 100644 --- a/src/Domain/NBB.Domain.Abstractions/NBB.Domain.Abstractions.csproj +++ b/src/Domain/NBB.Domain.Abstractions/NBB.Domain.Abstractions.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Some DDD domain buiding blocks abstractions diff --git a/src/Domain/NBB.Domain/NBB.Domain.csproj b/src/Domain/NBB.Domain/NBB.Domain.csproj index b6f7e7d6..b3ebd6f7 100644 --- a/src/Domain/NBB.Domain/NBB.Domain.csproj +++ b/src/Domain/NBB.Domain/NBB.Domain.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 A collection of DDD domain building blocks diff --git a/src/EventStore/NBB.EventStore.Abstractions/NBB.EventStore.Abstractions.csproj b/src/EventStore/NBB.EventStore.Abstractions/NBB.EventStore.Abstractions.csproj index ef03a601..c7d23c5c 100644 --- a/src/EventStore/NBB.EventStore.Abstractions/NBB.EventStore.Abstractions.csproj +++ b/src/EventStore/NBB.EventStore.Abstractions/NBB.EventStore.Abstractions.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 This package should contain common event store abstractions and should be references by event store dependent building blocks. diff --git a/src/EventStore/NBB.EventStore.AdoNet.Migrations/NBB.EventStore.AdoNet.Migrations.csproj b/src/EventStore/NBB.EventStore.AdoNet.Migrations/NBB.EventStore.AdoNet.Migrations.csproj index 3b85e234..0db44c56 100644 --- a/src/EventStore/NBB.EventStore.AdoNet.Migrations/NBB.EventStore.AdoNet.Migrations.csproj +++ b/src/EventStore/NBB.EventStore.AdoNet.Migrations/NBB.EventStore.AdoNet.Migrations.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_EventStoreAdoNetMigrations_f43f7048-9bff-4649-881c-97774e23e9f8 diff --git a/src/EventStore/NBB.EventStore.AdoNet.Multitenancy/NBB.EventStore.AdoNet.MultiTenancy.csproj b/src/EventStore/NBB.EventStore.AdoNet.Multitenancy/NBB.EventStore.AdoNet.MultiTenancy.csproj index 7516a3db..ae788cb0 100644 --- a/src/EventStore/NBB.EventStore.AdoNet.Multitenancy/NBB.EventStore.AdoNet.MultiTenancy.csproj +++ b/src/EventStore/NBB.EventStore.AdoNet.Multitenancy/NBB.EventStore.AdoNet.MultiTenancy.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 This package contains an event repository built with plain old Ado.Net diff --git a/src/EventStore/NBB.EventStore.AdoNet/NBB.EventStore.AdoNet.csproj b/src/EventStore/NBB.EventStore.AdoNet/NBB.EventStore.AdoNet.csproj index f2ada179..48e9bcdd 100644 --- a/src/EventStore/NBB.EventStore.AdoNet/NBB.EventStore.AdoNet.csproj +++ b/src/EventStore/NBB.EventStore.AdoNet/NBB.EventStore.AdoNet.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 This package contains an event repository built with plain old Ado.Net diff --git a/src/EventStore/NBB.EventStore.Effects/NBB.EventStore.Effects.csproj b/src/EventStore/NBB.EventStore.Effects/NBB.EventStore.Effects.csproj index f2a62d75..843009e9 100644 --- a/src/EventStore/NBB.EventStore.Effects/NBB.EventStore.Effects.csproj +++ b/src/EventStore/NBB.EventStore.Effects/NBB.EventStore.Effects.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/EventStore/NBB.EventStore.InMemory/NBB.EventStore.InMemory.csproj b/src/EventStore/NBB.EventStore.InMemory/NBB.EventStore.InMemory.csproj index 0907cbaa..d87a277e 100644 --- a/src/EventStore/NBB.EventStore.InMemory/NBB.EventStore.InMemory.csproj +++ b/src/EventStore/NBB.EventStore.InMemory/NBB.EventStore.InMemory.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/EventStore/NBB.EventStore/NBB.EventStore.csproj b/src/EventStore/NBB.EventStore/NBB.EventStore.csproj index f488e99c..3dd3f804 100644 --- a/src/EventStore/NBB.EventStore/NBB.EventStore.csproj +++ b/src/EventStore/NBB.EventStore/NBB.EventStore.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 This package contains a modest implementation of an event store. diff --git a/src/EventStore/NBB.SQLStreamStore.Migrations/NBB.SQLStreamStore.Migrations.csproj b/src/EventStore/NBB.SQLStreamStore.Migrations/NBB.SQLStreamStore.Migrations.csproj index e55d07e0..7bf73aa9 100644 --- a/src/EventStore/NBB.SQLStreamStore.Migrations/NBB.SQLStreamStore.Migrations.csproj +++ b/src/EventStore/NBB.SQLStreamStore.Migrations/NBB.SQLStreamStore.Migrations.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_SqlStreamStore_Migrations_cc6382af-cd19-4d46-8084-9dca6c4ab82b diff --git a/src/EventStore/NBB.SQLStreamStore/NBB.SQLStreamStore.csproj b/src/EventStore/NBB.SQLStreamStore/NBB.SQLStreamStore.csproj index 8819d1ba..8aa2ee20 100644 --- a/src/EventStore/NBB.SQLStreamStore/NBB.SQLStreamStore.csproj +++ b/src/EventStore/NBB.SQLStreamStore/NBB.SQLStreamStore.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/src/Http/NBB.Http.Effects/NBB.Http.Effects.csproj b/src/Http/NBB.Http.Effects/NBB.Http.Effects.csproj index 1596da95..2ef764b7 100644 --- a/src/Http/NBB.Http.Effects/NBB.Http.Effects.csproj +++ b/src/Http/NBB.Http.Effects/NBB.Http.Effects.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Messaging/NBB.Messaging.Abstractions/NBB.Messaging.Abstractions.csproj b/src/Messaging/NBB.Messaging.Abstractions/NBB.Messaging.Abstractions.csproj index 7f84b030..66eb7ca6 100644 --- a/src/Messaging/NBB.Messaging.Abstractions/NBB.Messaging.Abstractions.csproj +++ b/src/Messaging/NBB.Messaging.Abstractions/NBB.Messaging.Abstractions.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 A few lightweight messaging abstractions diff --git a/src/Messaging/NBB.Messaging.BackwardCompatibility/NBB.Messaging.BackwardCompatibility.csproj b/src/Messaging/NBB.Messaging.BackwardCompatibility/NBB.Messaging.BackwardCompatibility.csproj index 427b3f63..bab06519 100644 --- a/src/Messaging/NBB.Messaging.BackwardCompatibility/NBB.Messaging.BackwardCompatibility.csproj +++ b/src/Messaging/NBB.Messaging.BackwardCompatibility/NBB.Messaging.BackwardCompatibility.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Messaging/NBB.Messaging.DataContracts/NBB.Messaging.DataContracts.csproj b/src/Messaging/NBB.Messaging.DataContracts/NBB.Messaging.DataContracts.csproj index fb677caf..423fa63e 100644 --- a/src/Messaging/NBB.Messaging.DataContracts/NBB.Messaging.DataContracts.csproj +++ b/src/Messaging/NBB.Messaging.DataContracts/NBB.Messaging.DataContracts.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 This package helps us formalize and instrument messaging data contracts. diff --git a/src/Messaging/NBB.Messaging.Effects/NBB.Messaging.Effects.csproj b/src/Messaging/NBB.Messaging.Effects/NBB.Messaging.Effects.csproj index 2ca8de86..50ef0049 100644 --- a/src/Messaging/NBB.Messaging.Effects/NBB.Messaging.Effects.csproj +++ b/src/Messaging/NBB.Messaging.Effects/NBB.Messaging.Effects.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Messaging/NBB.Messaging.Host/NBB.Messaging.Host.csproj b/src/Messaging/NBB.Messaging.Host/NBB.Messaging.Host.csproj index 9ccba1f4..27b0d470 100644 --- a/src/Messaging/NBB.Messaging.Host/NBB.Messaging.Host.csproj +++ b/src/Messaging/NBB.Messaging.Host/NBB.Messaging.Host.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 Messaging subscriber host diff --git a/src/Messaging/NBB.Messaging.InProcessMessaging/NBB.Messaging.InProcessMessaging.csproj b/src/Messaging/NBB.Messaging.InProcessMessaging/NBB.Messaging.InProcessMessaging.csproj index 24422fe6..1f82719e 100644 --- a/src/Messaging/NBB.Messaging.InProcessMessaging/NBB.Messaging.InProcessMessaging.csproj +++ b/src/Messaging/NBB.Messaging.InProcessMessaging/NBB.Messaging.InProcessMessaging.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 InProcessMessaging provides in process comunication for Monolithic applications composed from decoupled bounded contexts diff --git a/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj b/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj index c2d1fb63..b3058632 100644 --- a/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj +++ b/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Nats JetStream messaging diff --git a/src/Messaging/NBB.Messaging.MultiTenancy/NBB.Messaging.MultiTenancy.csproj b/src/Messaging/NBB.Messaging.MultiTenancy/NBB.Messaging.MultiTenancy.csproj index 156e8c3b..1db817d0 100644 --- a/src/Messaging/NBB.Messaging.MultiTenancy/NBB.Messaging.MultiTenancy.csproj +++ b/src/Messaging/NBB.Messaging.MultiTenancy/NBB.Messaging.MultiTenancy.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj b/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj index d2fc424c..00619f59 100644 --- a/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj +++ b/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Nats messaging diff --git a/src/Messaging/NBB.Messaging.Noop/NBB.Messaging.Noop.csproj b/src/Messaging/NBB.Messaging.Noop/NBB.Messaging.Noop.csproj index 8dd5b22b..ba6ccb67 100644 --- a/src/Messaging/NBB.Messaging.Noop/NBB.Messaging.Noop.csproj +++ b/src/Messaging/NBB.Messaging.Noop/NBB.Messaging.Noop.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 Noop messaging diff --git a/src/Messaging/NBB.Messaging.OpenTelemetry/NBB.Messaging.OpenTelemetry.csproj b/src/Messaging/NBB.Messaging.OpenTelemetry/NBB.Messaging.OpenTelemetry.csproj index 4a08e84e..f53ccf13 100644 --- a/src/Messaging/NBB.Messaging.OpenTelemetry/NBB.Messaging.OpenTelemetry.csproj +++ b/src/Messaging/NBB.Messaging.OpenTelemetry/NBB.Messaging.OpenTelemetry.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj b/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj index a8fbc336..a9e2de2e 100644 --- a/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj +++ b/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj @@ -7,7 +7,7 @@ - net7.0 + net8.0 Rusi client transport diff --git a/src/MultiTenancy/NBB.MultiTenancy.Abstractions/NBB.MultiTenancy.Abstractions.csproj b/src/MultiTenancy/NBB.MultiTenancy.Abstractions/NBB.MultiTenancy.Abstractions.csproj index d69fcb9b..6b3d800d 100644 --- a/src/MultiTenancy/NBB.MultiTenancy.Abstractions/NBB.MultiTenancy.Abstractions.csproj +++ b/src/MultiTenancy/NBB.MultiTenancy.Abstractions/NBB.MultiTenancy.Abstractions.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/MultiTenancy/NBB.MultiTenancy.AspNet/NBB.MultiTenancy.AspNet.csproj b/src/MultiTenancy/NBB.MultiTenancy.AspNet/NBB.MultiTenancy.AspNet.csproj index 670a323e..51d06253 100644 --- a/src/MultiTenancy/NBB.MultiTenancy.AspNet/NBB.MultiTenancy.AspNet.csproj +++ b/src/MultiTenancy/NBB.MultiTenancy.AspNet/NBB.MultiTenancy.AspNet.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/MultiTenancy/NBB.MultiTenancy.Identification.Http/NBB.MultiTenancy.Identification.Http.csproj b/src/MultiTenancy/NBB.MultiTenancy.Identification.Http/NBB.MultiTenancy.Identification.Http.csproj index e905d4bb..abfe22dd 100644 --- a/src/MultiTenancy/NBB.MultiTenancy.Identification.Http/NBB.MultiTenancy.Identification.Http.csproj +++ b/src/MultiTenancy/NBB.MultiTenancy.Identification.Http/NBB.MultiTenancy.Identification.Http.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/MultiTenancy/NBB.MultiTenancy.Identification.Messaging/NBB.MultiTenancy.Identification.Messaging.csproj b/src/MultiTenancy/NBB.MultiTenancy.Identification.Messaging/NBB.MultiTenancy.Identification.Messaging.csproj index 197d6697..8298478c 100644 --- a/src/MultiTenancy/NBB.MultiTenancy.Identification.Messaging/NBB.MultiTenancy.Identification.Messaging.csproj +++ b/src/MultiTenancy/NBB.MultiTenancy.Identification.Messaging/NBB.MultiTenancy.Identification.Messaging.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/MultiTenancy/NBB.MultiTenancy.Identification/NBB.MultiTenancy.Identification.csproj b/src/MultiTenancy/NBB.MultiTenancy.Identification/NBB.MultiTenancy.Identification.csproj index fe0285a1..2377ece1 100644 --- a/src/MultiTenancy/NBB.MultiTenancy.Identification/NBB.MultiTenancy.Identification.csproj +++ b/src/MultiTenancy/NBB.MultiTenancy.Identification/NBB.MultiTenancy.Identification.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj b/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj index 250ec990..aca69f2a 100644 --- a/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj +++ b/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 Process manager definition builder. diff --git a/src/Orchestration/NBB.ProcessManager.Runtime/NBB.ProcessManager.Runtime.csproj b/src/Orchestration/NBB.ProcessManager.Runtime/NBB.ProcessManager.Runtime.csproj index 4a3a960e..7c09a717 100644 --- a/src/Orchestration/NBB.ProcessManager.Runtime/NBB.ProcessManager.Runtime.csproj +++ b/src/Orchestration/NBB.ProcessManager.Runtime/NBB.ProcessManager.Runtime.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Projections/NBB.ProjectR/NBB.ProjectR.csproj b/src/Projections/NBB.ProjectR/NBB.ProjectR.csproj index df2fd21d..2ed25d98 100644 --- a/src/Projections/NBB.ProjectR/NBB.ProjectR.csproj +++ b/src/Projections/NBB.ProjectR/NBB.ProjectR.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.ServiceIdentifier/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.csproj b/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.ServiceIdentifier/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.csproj index 924c55ea..e3f80723 100644 --- a/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.ServiceIdentifier/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.csproj +++ b/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.ServiceIdentifier/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.TenantId/NBB.Tools.Serilog.Enrichers.TenantId.csproj b/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.TenantId/NBB.Tools.Serilog.Enrichers.TenantId.csproj index a0ab01d8..6b2a128f 100644 --- a/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.TenantId/NBB.Tools.Serilog.Enrichers.TenantId.csproj +++ b/src/Tools/Serilog/NBB.Tools.Serilog.Enrichers.TenantId/NBB.Tools.Serilog.Enrichers.TenantId.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/Tools/Serilog/NBB.Tools.Serilog.OpenTelemetryTracingSink/NBB.Tools.Serilog.OpenTelemetryTracingSink.csproj b/src/Tools/Serilog/NBB.Tools.Serilog.OpenTelemetryTracingSink/NBB.Tools.Serilog.OpenTelemetryTracingSink.csproj index d4e2fd6b..256fe835 100644 --- a/src/Tools/Serilog/NBB.Tools.Serilog.OpenTelemetryTracingSink/NBB.Tools.Serilog.OpenTelemetryTracingSink.csproj +++ b/src/Tools/Serilog/NBB.Tools.Serilog.OpenTelemetryTracingSink/NBB.Tools.Serilog.OpenTelemetryTracingSink.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectsBenchmarks.fsproj b/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectsBenchmarks.fsproj index ccdaf82a..29cb6a8d 100644 --- a/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectsBenchmarks.fsproj +++ b/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectsBenchmarks.fsproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 diff --git a/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj b/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj index 1dce1b44..69048d39 100644 --- a/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj +++ b/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 NBB_TheBenchmarks_4e36178d-da86-4206-8332-54c8f5bb818b diff --git a/test/Integration/NBB.EventStore.IntegrationTests/NBB.EventStore.IntegrationTests.csproj b/test/Integration/NBB.EventStore.IntegrationTests/NBB.EventStore.IntegrationTests.csproj index 3f8f5421..b81544d5 100644 --- a/test/Integration/NBB.EventStore.IntegrationTests/NBB.EventStore.IntegrationTests.csproj +++ b/test/Integration/NBB.EventStore.IntegrationTests/NBB.EventStore.IntegrationTests.csproj @@ -9,7 +9,7 @@ Library - net7.0 + net8.0 NBB_EventStoreIntegrationTests_1b7f48bb-0e9a-4219-b794-1788abaf788e diff --git a/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj b/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj index d134df8b..af6563c4 100644 --- a/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj +++ b/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable diff --git a/test/UnitTests/Application/NBB.Application.Effects.Tests/NBB.Application.Effects.Tests.csproj b/test/UnitTests/Application/NBB.Application.Effects.Tests/NBB.Application.Effects.Tests.csproj index dc6347eb..84da3d44 100644 --- a/test/UnitTests/Application/NBB.Application.Effects.Tests/NBB.Application.Effects.Tests.csproj +++ b/test/UnitTests/Application/NBB.Application.Effects.Tests/NBB.Application.Effects.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/NBB.Application.Mediator.FSharp.Tests.fsproj b/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/NBB.Application.Mediator.FSharp.Tests.fsproj index 4af1a05a..56898ce8 100644 --- a/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/NBB.Application.Mediator.FSharp.Tests.fsproj +++ b/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/NBB.Application.Mediator.FSharp.Tests.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false false diff --git a/test/UnitTests/Core/NBB.Core.Configuration.Tests/NBB.Core.Configuration.Tests.csproj b/test/UnitTests/Core/NBB.Core.Configuration.Tests/NBB.Core.Configuration.Tests.csproj index 6244fa64..f8f1c5d0 100644 --- a/test/UnitTests/Core/NBB.Core.Configuration.Tests/NBB.Core.Configuration.Tests.csproj +++ b/test/UnitTests/Core/NBB.Core.Configuration.Tests/NBB.Core.Configuration.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false diff --git a/test/UnitTests/Core/NBB.Core.Effects.FSharp.Tests/NBB.Core.Effects.FSharp.Tests.fsproj b/test/UnitTests/Core/NBB.Core.Effects.FSharp.Tests/NBB.Core.Effects.FSharp.Tests.fsproj index 3830b233..f5b6ba07 100644 --- a/test/UnitTests/Core/NBB.Core.Effects.FSharp.Tests/NBB.Core.Effects.FSharp.Tests.fsproj +++ b/test/UnitTests/Core/NBB.Core.Effects.FSharp.Tests/NBB.Core.Effects.FSharp.Tests.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false false diff --git a/test/UnitTests/Core/NBB.Core.Effects.Tests/NBB.Core.Effects.Tests.csproj b/test/UnitTests/Core/NBB.Core.Effects.Tests/NBB.Core.Effects.Tests.csproj index 8b5f46c4..27151007 100644 --- a/test/UnitTests/Core/NBB.Core.Effects.Tests/NBB.Core.Effects.Tests.csproj +++ b/test/UnitTests/Core/NBB.Core.Effects.Tests/NBB.Core.Effects.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj b/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj index 4ec729d0..b660e835 100644 --- a/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj +++ b/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false false diff --git a/test/UnitTests/Core/NBB.Core.Pipeline.Tests/NBB.Core.Pipeline.Tests.csproj b/test/UnitTests/Core/NBB.Core.Pipeline.Tests/NBB.Core.Pipeline.Tests.csproj index 24913978..105d72c8 100644 --- a/test/UnitTests/Core/NBB.Core.Pipeline.Tests/NBB.Core.Pipeline.Tests.csproj +++ b/test/UnitTests/Core/NBB.Core.Pipeline.Tests/NBB.Core.Pipeline.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Data/NBB.Data.EntityFramework.MultiTenancy.Tests/NBB.Data.EntityFramework.MultiTenancy.Tests.csproj b/test/UnitTests/Data/NBB.Data.EntityFramework.MultiTenancy.Tests/NBB.Data.EntityFramework.MultiTenancy.Tests.csproj index 0ea20e7f..fc458f79 100644 --- a/test/UnitTests/Data/NBB.Data.EntityFramework.MultiTenancy.Tests/NBB.Data.EntityFramework.MultiTenancy.Tests.csproj +++ b/test/UnitTests/Data/NBB.Data.EntityFramework.MultiTenancy.Tests/NBB.Data.EntityFramework.MultiTenancy.Tests.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/test/UnitTests/Data/NBB.Data.EntityFramework.Tests/NBB.Data.EntityFramework.Tests.csproj b/test/UnitTests/Data/NBB.Data.EntityFramework.Tests/NBB.Data.EntityFramework.Tests.csproj index b9f388a8..aa21e4a6 100644 --- a/test/UnitTests/Data/NBB.Data.EntityFramework.Tests/NBB.Data.EntityFramework.Tests.csproj +++ b/test/UnitTests/Data/NBB.Data.EntityFramework.Tests/NBB.Data.EntityFramework.Tests.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/NBB.Data.EventSourcing.Tests.csproj b/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/NBB.Data.EventSourcing.Tests.csproj index f7a5c20e..8314d7f6 100644 --- a/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/NBB.Data.EventSourcing.Tests.csproj +++ b/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/NBB.Data.EventSourcing.Tests.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/test/UnitTests/Domain/NBB.Domain.Tests/NBB.Domain.Tests.csproj b/test/UnitTests/Domain/NBB.Domain.Tests/NBB.Domain.Tests.csproj index e9d70865..c1246d8e 100644 --- a/test/UnitTests/Domain/NBB.Domain.Tests/NBB.Domain.Tests.csproj +++ b/test/UnitTests/Domain/NBB.Domain.Tests/NBB.Domain.Tests.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj b/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj index f1470c82..7fd62b10 100644 --- a/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj +++ b/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/EventStore/NBB.EventStore.InMemory.Tests/NBB.EventStore.InMemory.Tests.csproj b/test/UnitTests/EventStore/NBB.EventStore.InMemory.Tests/NBB.EventStore.InMemory.Tests.csproj index 8bd15979..95a26095 100644 --- a/test/UnitTests/EventStore/NBB.EventStore.InMemory.Tests/NBB.EventStore.InMemory.Tests.csproj +++ b/test/UnitTests/EventStore/NBB.EventStore.InMemory.Tests/NBB.EventStore.InMemory.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/EventStore/NBB.EventStore.Tests/NBB.EventStore.Tests.csproj b/test/UnitTests/EventStore/NBB.EventStore.Tests/NBB.EventStore.Tests.csproj index d0af00be..5fa38336 100644 --- a/test/UnitTests/EventStore/NBB.EventStore.Tests/NBB.EventStore.Tests.csproj +++ b/test/UnitTests/EventStore/NBB.EventStore.Tests/NBB.EventStore.Tests.csproj @@ -8,7 +8,7 @@ - net7.0 + net8.0 diff --git a/test/UnitTests/Http/NBB.Http.Effects.Tests/NBB.Http.Effects.Tests.csproj b/test/UnitTests/Http/NBB.Http.Effects.Tests/NBB.Http.Effects.Tests.csproj index 9ed3f4cd..2bfb2bfc 100644 --- a/test/UnitTests/Http/NBB.Http.Effects.Tests/NBB.Http.Effects.Tests.csproj +++ b/test/UnitTests/Http/NBB.Http.Effects.Tests/NBB.Http.Effects.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Messaging/NBB.Messaging.Abstractions.Tests/NBB.Messaging.Abstractions.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.Abstractions.Tests/NBB.Messaging.Abstractions.Tests.csproj index 85e4c2d0..fcad1d6f 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Abstractions.Tests/NBB.Messaging.Abstractions.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.Abstractions.Tests/NBB.Messaging.Abstractions.Tests.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 diff --git a/test/UnitTests/Messaging/NBB.Messaging.DataContracts.Tests/NBB.Messaging.DataContracts.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.DataContracts.Tests/NBB.Messaging.DataContracts.Tests.csproj index 0855d770..f95a4d17 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.DataContracts.Tests/NBB.Messaging.DataContracts.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.DataContracts.Tests/NBB.Messaging.DataContracts.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Messaging/NBB.Messaging.Effects.Tests/NBB.Messaging.Effects.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.Effects.Tests/NBB.Messaging.Effects.Tests.csproj index cd7fff41..b7e446bb 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Effects.Tests/NBB.Messaging.Effects.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.Effects.Tests/NBB.Messaging.Effects.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/NBB.Messaging.Host.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/NBB.Messaging.Host.Tests.csproj index f02f1d89..6e6f802c 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/NBB.Messaging.Host.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/NBB.Messaging.Host.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Messaging/NBB.Messaging.InProcessMessaging.Tests/NBB.Messaging.InProcessMessaging.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.InProcessMessaging.Tests/NBB.Messaging.InProcessMessaging.Tests.csproj index e2ff15ca..1bedbc33 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.InProcessMessaging.Tests/NBB.Messaging.InProcessMessaging.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.InProcessMessaging.Tests/NBB.Messaging.InProcessMessaging.Tests.csproj @@ -9,7 +9,7 @@ Exe - net7.0 + net8.0 diff --git a/test/UnitTests/Messaging/NBB.Messaging.MultiTenancy.Tests/NBB.Messaging.MultiTenancy.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.MultiTenancy.Tests/NBB.Messaging.MultiTenancy.Tests.csproj index b5e95163..50184f72 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.MultiTenancy.Tests/NBB.Messaging.MultiTenancy.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.MultiTenancy.Tests/NBB.Messaging.MultiTenancy.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Messaging/NBB.Messaging.Rusi.Tests/NBB.Messaging.Rusi.Tests.csproj b/test/UnitTests/Messaging/NBB.Messaging.Rusi.Tests/NBB.Messaging.Rusi.Tests.csproj index 5bcec53e..2c949f30 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Rusi.Tests/NBB.Messaging.Rusi.Tests.csproj +++ b/test/UnitTests/Messaging/NBB.Messaging.Rusi.Tests/NBB.Messaging.Rusi.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Configuration.Tests/NBB.MultiTenancy.Abstractions.Tests.csproj b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Configuration.Tests/NBB.MultiTenancy.Abstractions.Tests.csproj index c7b2de36..bdb7d5ca 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Configuration.Tests/NBB.MultiTenancy.Abstractions.Tests.csproj +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Configuration.Tests/NBB.MultiTenancy.Abstractions.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/NBB.MultiTenancy.Identification.Http.Tests.csproj b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/NBB.MultiTenancy.Identification.Http.Tests.csproj index 4f126f78..4fbd9cc2 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/NBB.MultiTenancy.Identification.Http.Tests.csproj +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/NBB.MultiTenancy.Identification.Http.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Messaging.Tests/NBB.MultiTenancy.Identification.Messaging.Tests.csproj b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Messaging.Tests/NBB.MultiTenancy.Identification.Messaging.Tests.csproj index e809333c..d8a0408d 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Messaging.Tests/NBB.MultiTenancy.Identification.Messaging.Tests.csproj +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Messaging.Tests/NBB.MultiTenancy.Identification.Messaging.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/NBB.MultiTenancy.Identification.Tests.csproj b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/NBB.MultiTenancy.Identification.Tests.csproj index b6e29675..f6a8752d 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/NBB.MultiTenancy.Identification.Tests.csproj +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/NBB.MultiTenancy.Identification.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/NBB.Core.FSharp.Tests/NBB.Core.FSharp.Tests.fsproj b/test/UnitTests/NBB.Core.FSharp.Tests/NBB.Core.FSharp.Tests.fsproj index 46a65be3..b85493ec 100644 --- a/test/UnitTests/NBB.Core.FSharp.Tests/NBB.Core.FSharp.Tests.fsproj +++ b/test/UnitTests/NBB.Core.FSharp.Tests/NBB.Core.FSharp.Tests.fsproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false false diff --git a/test/UnitTests/Orchestration/NBB.ProcessManager.Tests/NBB.ProcessManager.Tests.csproj b/test/UnitTests/Orchestration/NBB.ProcessManager.Tests/NBB.ProcessManager.Tests.csproj index 8942213a..7204837f 100644 --- a/test/UnitTests/Orchestration/NBB.ProcessManager.Tests/NBB.ProcessManager.Tests.csproj +++ b/test/UnitTests/Orchestration/NBB.ProcessManager.Tests/NBB.ProcessManager.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj b/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj index 1c2a309c..5e366a22 100644 --- a/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj +++ b/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests.csproj b/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests.csproj index 47e67fe6..ee85917a 100644 --- a/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests.csproj +++ b/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests/NBB.Tools.Serilog.Enrichers.ServiceIdentifier.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.TenantId.Tests/NBB.Tools.Serilog.Enrichers.TenantId.Tests.csproj b/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.TenantId.Tests/NBB.Tools.Serilog.Enrichers.TenantId.Tests.csproj index 46afb5b5..f94303c3 100644 --- a/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.TenantId.Tests/NBB.Tools.Serilog.Enrichers.TenantId.Tests.csproj +++ b/test/UnitTests/Tools/NBB.Tools.Serilog.Enrichers.TenantId.Tests/NBB.Tools.Serilog.Enrichers.TenantId.Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false From 14d9d8a3577a59916a46177b8f33afcccd2a111d Mon Sep 17 00:00:00 2001 From: Lucian Ghinet Date: Fri, 24 Nov 2023 16:43:11 +0200 Subject: [PATCH 02/11] v2 --- dependencies.props | 77 ++- .../ContractCommandHandlers.cs | 12 +- .../NBB.Contracts.Worker.csproj | 2 +- .../NBB.Contracts.Worker/Program.cs | 3 +- .../CreateInvoiceCommandHandler.cs | 50 +- .../MarkInvoiceAsPayedCommandHandler.cs | 3 +- .../ProcessInvoiceCommandHandler.cs | 2 +- .../NBB.Invoices.Worker.csproj | 2 +- .../NBB.Invoices.Worker/Program.cs | 2 +- .../NBB.MicroServicesOrchestration.csproj | 2 +- .../NBB.MicroServicesOrchestration/Program.cs | 2 +- .../CreatePayableCommandHandler.cs | 4 +- .../PayPayableCommandHandler.cs | 60 +- .../NBB.Payments.Worker.csproj | 2 +- .../NBB.Payments.Worker/Program.cs | 164 ++--- samples/Monolith/NBB.Mono/NBB.Mono.csproj | 2 +- samples/Monolith/NBB.Mono/Startup.cs | 200 +++--- .../Application/CreateTodoTaskHandler.cs | 5 +- .../NBB.Todo.Worker/NBB.Todo.Worker.csproj | 2 +- .../MultiTenancy/NBB.Todo.Worker/Program.cs | 2 +- .../ProcessManagerSample.csproj | 2 +- .../ProcessManagerSample/Startup.cs | 2 +- .../Mediator.cs | 170 ++--- .../Builder/MediatRMessagingHostExtensions.cs | 2 +- .../NBB.Messaging.Rusi.csproj | 86 +-- .../EventSourcedRepositoryBenchmark.cs | 588 +++++++++--------- .../EventStoreBenchmarks.csproj | 2 +- .../SnapshotStoreDBIntegrationTests.cs | 330 +++++----- .../EventSourcedRepositoryTests.cs | 577 ++++++++--------- .../MessagingHostBuilderTests.cs | 4 +- .../TenantTokenResolverConfigurationTests.cs | 14 +- .../NBB.ProjectR.Tests.csproj | 2 +- .../NBB.ProjectR.Tests/TestFixture.cs | 54 +- 33 files changed, 1210 insertions(+), 1221 deletions(-) diff --git a/dependencies.props b/dependencies.props index 9d32a4dd..6544dbcf 100644 --- a/dependencies.props +++ b/dependencies.props @@ -1,41 +1,40 @@  - - 13.0.1 - 11.1.0 - 1.0.1 - 11.0.0 - 3.3.0 - 0.13.1 - 4.16.1 - 2.4.1 - 2.4.3 - 3.1.0 - 17.0.0 - 4.1.0 - 6.3.0 - 5.0.1 - 7.0.0 - 7.0.0 - 4.7.0 - 1.5.0 - 1.5.0 - 1.5.0 - 1.0.0-rc9.14 - 1.0.0-beta.7 - 1.0.0-rc9.14 - 1.5.0 - 1.5.0-rc.1 - 1.5.0-rc.1 - 7.2.2 - 2.10.0 - 3.1.0 - 4.0.1 - 5.6.1 - 4.1.0 - 12.0.0 - 10.6.6 - 4.17.0 - 1.0.3 - 6.15.0 - + + 13.0.1 + 12.2.0 + 2.0.1 + 3.3.0 + 0.13.1 + 4.20.69 + 2.4.1 + 2.4.3 + 3.1.0 + 17.0.0 + 4.1.0 + 6.3.0 + 5.0.1 + 8.0.0 + 8.0.0 + 4.7.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.0.0-rc9.14 + 1.0.0-beta.7 + 1.0.0-rc9.14 + 1.5.0 + 1.5.0-rc.1 + 1.5.0-rc.1 + 7.2.2 + 2.10.0 + 3.1.0 + 4.0.1 + 5.6.1 + 4.1.0 + 12.0.0 + 10.6.6 + 4.17.0 + 1.0.3 + 6.15.0 + diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/CommandHandlers/ContractCommandHandlers.cs b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/CommandHandlers/ContractCommandHandlers.cs index 18b2af11..d7514827 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/CommandHandlers/ContractCommandHandlers.cs +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Application/CommandHandlers/ContractCommandHandlers.cs @@ -27,25 +27,21 @@ public ContractCommandHandlers(IEventSourcedRepository repository, Con _logger = logger; } - public async Task Handle(CreateContract command, CancellationToken cancellationToken) + public async Task Handle(CreateContract command, CancellationToken cancellationToken) { var contract = new Contract(command.ClientId); await _repository.SaveAsync(contract, cancellationToken); _domainMetrics.ContractCreated(); - - return Unit.Value; } - public async Task Handle(AddContractLine command, CancellationToken cancellationToken) + public async Task Handle(AddContractLine command, CancellationToken cancellationToken) { var contract = await _repository.GetByIdAsync(command.ContractId, cancellationToken); contract.AddContractLine(command.Product, command.Price, command.Quantity); await _repository.SaveAsync(contract, cancellationToken); - - return Unit.Value; } - public async Task Handle(ValidateContract command, CancellationToken cancellationToken) + public async Task Handle(ValidateContract command, CancellationToken cancellationToken) { _logger.LogInformation("Validating contract"); @@ -53,8 +49,6 @@ public async Task Handle(ValidateContract command, CancellationToken cance contract.Validate(); await _repository.SaveAsync(contract, cancellationToken); _domainMetrics.ContractValidated(); - - return Unit.Value; } } } diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj index 9c1499f6..24ebe62c 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj @@ -20,7 +20,7 @@ - + diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs index 1048aec5..7ea4c03f 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs @@ -45,8 +45,7 @@ public static async Task Main(string[] args) }) .ConfigureServices((hostingContext, services) => { - services.AddMediatR(typeof(ContractCommandHandlers).Assembly); - + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); var transport = hostingContext.Configuration.GetValue("Messaging:Transport", "NATS"); if (transport.Equals("NATS", StringComparison.InvariantCultureIgnoreCase)) diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/CreateInvoiceCommandHandler.cs b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/CreateInvoiceCommandHandler.cs index 14e556b6..bd47811d 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/CreateInvoiceCommandHandler.cs +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/CreateInvoiceCommandHandler.cs @@ -1,30 +1,28 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using MediatR; -using NBB.Data.Abstractions; -using NBB.Invoices.Domain.InvoiceAggregate; +using MediatR; +using NBB.Data.Abstractions; +using NBB.Invoices.Domain.InvoiceAggregate; using NBB.Invoices.PublishedLanguage; -using System.Threading; -using System.Threading.Tasks; - -namespace NBB.Invoices.Application.CommandHandlers -{ - public class CreateInvoiceCommandHandler : IRequestHandler - { - private readonly ICrudRepository _repository; - public CreateInvoiceCommandHandler(ICrudRepository repository) - { - this._repository = repository; - } - - public async Task Handle(CreateInvoice command, CancellationToken cancellationToken) - { - var invoice = new Invoice(command.ClientId, command.ContractId, command.Amount); - await _repository.AddAsync(invoice, cancellationToken); - await _repository.SaveChangesAsync(cancellationToken); - - return Unit.Value; - } - } -} +using System.Threading; +using System.Threading.Tasks; + +namespace NBB.Invoices.Application.CommandHandlers +{ + public class CreateInvoiceCommandHandler : IRequestHandler + { + private readonly ICrudRepository _repository; + public CreateInvoiceCommandHandler(ICrudRepository repository) + { + this._repository = repository; + } + + public async Task Handle(CreateInvoice command, CancellationToken cancellationToken) + { + var invoice = new Invoice(command.ClientId, command.ContractId, command.Amount); + await _repository.AddAsync(invoice, cancellationToken); + await _repository.SaveChangesAsync(cancellationToken); + } + } +} diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/MarkInvoiceAsPayedCommandHandler.cs b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/MarkInvoiceAsPayedCommandHandler.cs index e11f6424..2160a29e 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/MarkInvoiceAsPayedCommandHandler.cs +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/MarkInvoiceAsPayedCommandHandler.cs @@ -18,7 +18,7 @@ public MarkInvoiceAsPayedCommandHandler(ICrudRepository repository) this._repository = repository; } - public async Task Handle(MarkInvoiceAsPayed command, CancellationToken cancellationToken) + public async Task Handle(MarkInvoiceAsPayed command, CancellationToken cancellationToken) { var invoice = await _repository.GetByIdAsync(command.InvoiceId, cancellationToken); if (invoice != null) @@ -27,7 +27,6 @@ public async Task Handle(MarkInvoiceAsPayed command, CancellationToken can await _repository.SaveChangesAsync(cancellationToken); } - return Unit.Value; } } } diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/ProcessInvoiceCommandHandler.cs b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/ProcessInvoiceCommandHandler.cs index 3114280b..9ef19f85 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/ProcessInvoiceCommandHandler.cs +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/ProcessInvoiceCommandHandler.cs @@ -22,7 +22,7 @@ public ProcessInvoiceCommandHandler(ICrudRepository invocieRepository, this._invoiceLockRepository = invoiceLockRepository; } - public Task Handle(ProcessInvoice command, CancellationToken cancellationToken) + public Task Handle(ProcessInvoice command, CancellationToken cancellationToken) => UsingInvoiceLock(command.InvoiceId, lockTimeoutMs: 10000, async () => { var invoice = await _invocieRepository.GetByIdAsync(command.InvoiceId, cancellationToken); diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj index 2b8304f2..7306d1cf 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/NBB.Invoices.Worker.csproj @@ -22,7 +22,7 @@ - + diff --git a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/Program.cs b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/Program.cs index 28747920..c3ba19ad 100644 --- a/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/Program.cs +++ b/samples/MicroServices/NBB.Invoices/NBB.Invoices.Worker/Program.cs @@ -48,7 +48,7 @@ public static async Task Main(string[] args) }) .ConfigureServices((hostingContext, services) => { - services.AddMediatR(typeof(CreateInvoiceCommandHandler).Assembly); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); services.AddMessageBus().AddNatsTransport(hostingContext.Configuration); services.AddInvoicesWriteDataAccess(); diff --git a/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj b/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj index 4b7af13f..9d2c9d01 100644 --- a/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj +++ b/samples/MicroServices/NBB.MicroServicesOrchestration/NBB.MicroServicesOrchestration.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/MicroServices/NBB.MicroServicesOrchestration/Program.cs b/samples/MicroServices/NBB.MicroServicesOrchestration/Program.cs index 3ef339d1..917f73b9 100644 --- a/samples/MicroServices/NBB.MicroServicesOrchestration/Program.cs +++ b/samples/MicroServices/NBB.MicroServicesOrchestration/Program.cs @@ -42,7 +42,7 @@ public static async Task Main(string[] args) }) .ConfigureServices((hostingContext, services) => { - services.AddMediatR(typeof(Program).Assembly); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); services.AddMessageBus().AddNatsTransport(hostingContext.Configuration); diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/CreatePayableCommandHandler.cs b/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/CreatePayableCommandHandler.cs index 74769d58..1b563f60 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/CreatePayableCommandHandler.cs +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/CreatePayableCommandHandler.cs @@ -20,13 +20,11 @@ public CreatePayableCommandHandler(ICrudRepository repository) _repository = repository; } - public async Task Handle(CreatePayable command, CancellationToken cancellationToken) + public async Task Handle(CreatePayable command, CancellationToken cancellationToken) { var payable = new Payable(command.ClientId, command.Amount, command.InvoiceId, command.ContractId); await _repository.AddAsync(payable, cancellationToken); await _repository.SaveChangesAsync(cancellationToken); - - return Unit.Value; } } diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/PayPayableCommandHandler.cs b/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/PayPayableCommandHandler.cs index 6b655282..6ea18ec7 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/PayPayableCommandHandler.cs +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Application/CommandHandlers/PayPayableCommandHandler.cs @@ -1,35 +1,33 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using MediatR; -using NBB.Data.Abstractions; -using NBB.Payments.Domain.PayableAggregate; +using MediatR; +using NBB.Data.Abstractions; +using NBB.Payments.Domain.PayableAggregate; using NBB.Payments.PublishedLanguage; -using System.Threading; -using System.Threading.Tasks; - -namespace NBB.Payments.Application.CommandHandlers -{ - public class PayPayableCommandHandler : IRequestHandler - { - private readonly ICrudRepository _repository; - - public PayPayableCommandHandler(ICrudRepository repository) - { - _repository = repository; - } - - - public async Task Handle(PayPayable command, CancellationToken cancellationToken) - { - var payable = await _repository.GetByIdAsync(command.PayableId, cancellationToken); - if (payable != null) - { - payable.Pay(); - await _repository.SaveChangesAsync(cancellationToken); - } - - return Unit.Value; - } - } -} +using System.Threading; +using System.Threading.Tasks; + +namespace NBB.Payments.Application.CommandHandlers +{ + public class PayPayableCommandHandler : IRequestHandler + { + private readonly ICrudRepository _repository; + + public PayPayableCommandHandler(ICrudRepository repository) + { + _repository = repository; + } + + + public async Task Handle(PayPayable command, CancellationToken cancellationToken) + { + var payable = await _repository.GetByIdAsync(command.PayableId, cancellationToken); + if (payable != null) + { + payable.Pay(); + await _repository.SaveChangesAsync(cancellationToken); + } + } + } +} diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj b/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj index 3cc506cc..dbce973c 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/NBB.Payments.Worker.csproj @@ -22,7 +22,7 @@ - + diff --git a/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/Program.cs b/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/Program.cs index 68b17ac0..e9721068 100644 --- a/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/Program.cs +++ b/samples/MicroServices/NBB.Payments/NBB.Payments.Worker/Program.cs @@ -1,89 +1,89 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using MediatR; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using NBB.Application.MediatR; -using NBB.Core.Abstractions; -using NBB.Correlation.Serilog; -using NBB.Domain; -using NBB.Domain.Abstractions; -using NBB.EventStore.Abstractions; -using NBB.Messaging.Host; -using NBB.Payments.Application.CommandHandlers; -using NBB.Payments.Data; -using Serilog; -using Serilog.Events; -using Serilog.Sinks.MSSqlServer; -using System.Threading; -using System.Threading.Tasks; - -namespace NBB.Payments.Worker -{ - public class Program - { - public static async Task Main(string[] args) - { - var builder = Host - .CreateDefaultBuilder(args) - .ConfigureLogging((hostingContext, loggingBuilder) => - { - var connectionString = hostingContext.Configuration.GetConnectionString("Logs"); - - Log.Logger = new LoggerConfiguration() - .MinimumLevel.Debug() - .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) - .Enrich.FromLogContext() - .Enrich.With() - .WriteTo.MSSqlServer(connectionString, - new MSSqlServerSinkOptions {TableName = "Logs", AutoCreateSqlTable = true}) - .CreateLogger(); - - loggingBuilder.AddSerilog(dispose: true); - loggingBuilder.AddFilter("Microsoft", logLevel => logLevel >= LogLevel.Warning); - loggingBuilder.AddConsole(); - }) - .ConfigureServices((hostingContext, services) => - { - services.AddMediatR(typeof(PayPayableCommandHandler).Assembly); - //services.AddKafkaMessaging(); - services.AddMessageBus().AddNatsTransport(hostingContext.Configuration); - - services.AddPaymentsWriteDataAccess(); - +using MediatR; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using NBB.Application.MediatR; +using NBB.Core.Abstractions; +using NBB.Correlation.Serilog; +using NBB.Domain; +using NBB.Domain.Abstractions; +using NBB.EventStore.Abstractions; +using NBB.Messaging.Host; +using NBB.Payments.Application.CommandHandlers; +using NBB.Payments.Data; +using Serilog; +using Serilog.Events; +using Serilog.Sinks.MSSqlServer; +using System.Threading; +using System.Threading.Tasks; + +namespace NBB.Payments.Worker +{ + public class Program + { + public static async Task Main(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureLogging((hostingContext, loggingBuilder) => + { + var connectionString = hostingContext.Configuration.GetConnectionString("Logs"); + + Log.Logger = new LoggerConfiguration() + .MinimumLevel.Debug() + .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) + .Enrich.FromLogContext() + .Enrich.With() + .WriteTo.MSSqlServer(connectionString, + new MSSqlServerSinkOptions {TableName = "Logs", AutoCreateSqlTable = true}) + .CreateLogger(); + + loggingBuilder.AddSerilog(dispose: true); + loggingBuilder.AddFilter("Microsoft", logLevel => logLevel >= LogLevel.Warning); + loggingBuilder.AddConsole(); + }) + .ConfigureServices((hostingContext, services) => + { + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); + //services.AddKafkaMessaging(); + services.AddMessageBus().AddNatsTransport(hostingContext.Configuration); + + services.AddPaymentsWriteDataAccess(); + services.AddEventStore(es => { es.UseNewtownsoftJson(new SingleValueObjectConverter()); es.UseAdoNetEventRepository(opts => opts.FromConfiguration()); - }); - - services.AddMessagingHost( - hostingContext.Configuration, - hostBuilder => hostBuilder - .Configure(configBuilder => configBuilder - .AddSubscriberServices(subscriberBuilder => subscriberBuilder - .FromMediatRHandledCommands().AddAllClasses() - .FromMediatRHandledEvents().AddAllClasses() - ) - .WithDefaultOptions() - .UsePipeline(pipelineBuilder => pipelineBuilder - .UseCorrelationMiddleware() - .UseExceptionHandlingMiddleware() - .UseDefaultResiliencyMiddleware() - .UseMediatRMiddleware() - ) - )); - - services - .Decorate(typeof(IUow<>), typeof(DomainUowDecorator<>)) - .Decorate(typeof(IUow<>), typeof(MediatorUowDecorator<>)) - .Decorate(typeof(IUow<>), typeof(EventStoreUowDecorator<>)); - }); - - await builder.RunConsoleAsync(CancellationToken.None); - } - } -} + }); + + services.AddMessagingHost( + hostingContext.Configuration, + hostBuilder => hostBuilder + .Configure(configBuilder => configBuilder + .AddSubscriberServices(subscriberBuilder => subscriberBuilder + .FromMediatRHandledCommands().AddAllClasses() + .FromMediatRHandledEvents().AddAllClasses() + ) + .WithDefaultOptions() + .UsePipeline(pipelineBuilder => pipelineBuilder + .UseCorrelationMiddleware() + .UseExceptionHandlingMiddleware() + .UseDefaultResiliencyMiddleware() + .UseMediatRMiddleware() + ) + )); + + services + .Decorate(typeof(IUow<>), typeof(DomainUowDecorator<>)) + .Decorate(typeof(IUow<>), typeof(MediatorUowDecorator<>)) + .Decorate(typeof(IUow<>), typeof(EventStoreUowDecorator<>)); + }); + + await builder.RunConsoleAsync(CancellationToken.None); + } + } +} diff --git a/samples/Monolith/NBB.Mono/NBB.Mono.csproj b/samples/Monolith/NBB.Mono/NBB.Mono.csproj index 1cd296e6..2ff22bda 100644 --- a/samples/Monolith/NBB.Mono/NBB.Mono.csproj +++ b/samples/Monolith/NBB.Mono/NBB.Mono.csproj @@ -18,7 +18,7 @@ - + diff --git a/samples/Monolith/NBB.Mono/Startup.cs b/samples/Monolith/NBB.Mono/Startup.cs index a9e83c0d..16f8e221 100644 --- a/samples/Monolith/NBB.Mono/Startup.cs +++ b/samples/Monolith/NBB.Mono/Startup.cs @@ -1,111 +1,111 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using MediatR; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using NBB.Application.MediatR; -using NBB.Contracts.Application.CommandHandlers; -using NBB.Contracts.ReadModel.Data; -using NBB.Contracts.WriteModel.Data; -using NBB.Core.Abstractions; -using NBB.Correlation.AspNet; -using NBB.Domain.Abstractions; -using NBB.EventStore.Abstractions; -using NBB.Invoices.Application.CommandHandlers; -using NBB.Invoices.Data; -using NBB.Payments.Application.CommandHandlers; -using NBB.Payments.Data; -using NBB.Domain; -using NBB.Messaging.Host; -using Microsoft.Extensions.Hosting; -using System.Linq; -using MicroServicesOrchestration; -using NBB.Core.DependencyInjection; - -namespace NBB.Mono -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(); - services.AddSingleton(Configuration); - services.AddMediatR( - typeof(ContractCommandHandlers).Assembly, - typeof(CreateInvoiceCommandHandler).Assembly, - typeof(PayPayableCommandHandler).Assembly); - - services.AddMessageBus().AddInProcessTransport(); - - services.AddContractsWriteModelDataAccess(); - services.AddContractsReadModelDataAccess(); - services.AddInvoicesDataAccess(); - services.AddPaymentsDataAccess(); - +using MediatR; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using NBB.Application.MediatR; +using NBB.Contracts.Application.CommandHandlers; +using NBB.Contracts.ReadModel.Data; +using NBB.Contracts.WriteModel.Data; +using NBB.Core.Abstractions; +using NBB.Correlation.AspNet; +using NBB.Domain.Abstractions; +using NBB.EventStore.Abstractions; +using NBB.Invoices.Application.CommandHandlers; +using NBB.Invoices.Data; +using NBB.Payments.Application.CommandHandlers; +using NBB.Payments.Data; +using NBB.Domain; +using NBB.Messaging.Host; +using Microsoft.Extensions.Hosting; +using System.Linq; +using MicroServicesOrchestration; +using NBB.Core.DependencyInjection; + +namespace NBB.Mono +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc(); + services.AddSingleton(Configuration); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies( + typeof(ContractCommandHandlers).Assembly, + typeof(CreateInvoiceCommandHandler).Assembly, + typeof(PayPayableCommandHandler).Assembly)); + + services.AddMessageBus().AddInProcessTransport(); + + services.AddContractsWriteModelDataAccess(); + services.AddContractsReadModelDataAccess(); + services.AddInvoicesDataAccess(); + services.AddPaymentsDataAccess(); + services.AddEventStore(es => { es.UseNewtownsoftJson(new SingleValueObjectConverter()); es.UseAdoNetEventRepository(opts => opts.FromConfiguration()); - }); - + }); + var integrationMessageAssemblies = new[] { typeof(NBB.Contracts.PublishedLanguage.ContractValidated).Assembly, typeof(NBB.Invoices.PublishedLanguage.InvoiceCreated).Assembly, typeof(NBB.Payments.PublishedLanguage.PayableCreated).Assembly, - }; - - services.AddMessagingHost( - Configuration, - hostBuilder => hostBuilder - .Configure(configBuilder => configBuilder - .AddSubscriberServices(subscriberBuiler => subscriberBuiler - .FromMediatRHandledCommands().AddClassesWhere(t => integrationMessageAssemblies.Contains(t.Assembly)) - .FromMediatRHandledEvents().AddClassesWhere(t => integrationMessageAssemblies.Contains(t.Assembly)) - ) - .WithDefaultOptions() - .UsePipeline(pipelineBuilder => pipelineBuilder - .UseExceptionHandlingMiddleware() - .UseCorrelationMiddleware() - .UseDefaultResiliencyMiddleware() - .UseMediatRMiddleware() - ) - ) - ); - - services.AddProcessManager(typeof(InvoicingProcessManager).Assembly); - - services.DecorateOpenGenericWhen(typeof(IUow<>), typeof(DomainUowDecorator<>), - serviceType => typeof(IEventedAggregateRoot).IsAssignableFrom(serviceType.GetGenericArguments()[0])); - services.DecorateOpenGenericWhen(typeof(IUow<>), typeof(MediatorUowDecorator<>), - serviceType => typeof(IEventedEntity).IsAssignableFrom(serviceType.GetGenericArguments()[0])); - services.DecorateOpenGenericWhen(typeof(IUow<>), typeof(EventStoreUowDecorator<>), - serviceType => typeof(IEventedEntity).IsAssignableFrom(serviceType.GetGenericArguments()[0]) && - typeof(IIdentifiedEntity).IsAssignableFrom(serviceType.GetGenericArguments()[0])); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - app.UseCorrelation(); - - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseRouting(); - app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); - } - } -} + }; + + services.AddMessagingHost( + Configuration, + hostBuilder => hostBuilder + .Configure(configBuilder => configBuilder + .AddSubscriberServices(subscriberBuiler => subscriberBuiler + .FromMediatRHandledCommands().AddClassesWhere(t => integrationMessageAssemblies.Contains(t.Assembly)) + .FromMediatRHandledEvents().AddClassesWhere(t => integrationMessageAssemblies.Contains(t.Assembly)) + ) + .WithDefaultOptions() + .UsePipeline(pipelineBuilder => pipelineBuilder + .UseExceptionHandlingMiddleware() + .UseCorrelationMiddleware() + .UseDefaultResiliencyMiddleware() + .UseMediatRMiddleware() + ) + ) + ); + + services.AddProcessManager(typeof(InvoicingProcessManager).Assembly); + + services.DecorateOpenGenericWhen(typeof(IUow<>), typeof(DomainUowDecorator<>), + serviceType => typeof(IEventedAggregateRoot).IsAssignableFrom(serviceType.GetGenericArguments()[0])); + services.DecorateOpenGenericWhen(typeof(IUow<>), typeof(MediatorUowDecorator<>), + serviceType => typeof(IEventedEntity).IsAssignableFrom(serviceType.GetGenericArguments()[0])); + services.DecorateOpenGenericWhen(typeof(IUow<>), typeof(EventStoreUowDecorator<>), + serviceType => typeof(IEventedEntity).IsAssignableFrom(serviceType.GetGenericArguments()[0]) && + typeof(IIdentifiedEntity).IsAssignableFrom(serviceType.GetGenericArguments()[0])); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + app.UseCorrelation(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + } + } +} diff --git a/samples/MultiTenancy/NBB.Todo.Worker/Application/CreateTodoTaskHandler.cs b/samples/MultiTenancy/NBB.Todo.Worker/Application/CreateTodoTaskHandler.cs index aee3a66e..72275265 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/Application/CreateTodoTaskHandler.cs +++ b/samples/MultiTenancy/NBB.Todo.Worker/Application/CreateTodoTaskHandler.cs @@ -19,7 +19,7 @@ public CreateTodoTaskHandler(ICrudRepository todoTaskRepository) _todoTaskRepository = todoTaskRepository; } - public async Task Handle(CreateTodoTask request, CancellationToken cancellationToken) + public async Task Handle(CreateTodoTask request, CancellationToken cancellationToken) { //throw new System.Exception("handler exception"); var todoTask = new TodoTask @@ -30,10 +30,7 @@ public async Task Handle(CreateTodoTask request, CancellationToken cancell }; await _todoTaskRepository.AddAsync(todoTask, cancellationToken); - await _todoTaskRepository.SaveChangesAsync(cancellationToken); - - return Unit.Value; } } } diff --git a/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj b/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj index 1eb1482a..7583bcef 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj +++ b/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj @@ -24,7 +24,7 @@ - + diff --git a/samples/MultiTenancy/NBB.Todo.Worker/Program.cs b/samples/MultiTenancy/NBB.Todo.Worker/Program.cs index 8711002a..36efb9f0 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/Program.cs +++ b/samples/MultiTenancy/NBB.Todo.Worker/Program.cs @@ -72,7 +72,7 @@ public static IHost BuildConsoleHost(string[] args) => private static void ConfigureServices(HostBuilderContext hostingContext, IServiceCollection services) { // MediatR - services.AddMediatR(typeof(CreateTodoTaskHandler).Assembly); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); // Data services.AddTodoDataAccess(); diff --git a/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj b/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj index c63952ab..50b70c87 100644 --- a/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj +++ b/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/Orchestration/ProcessManagerSample/Startup.cs b/samples/Orchestration/ProcessManagerSample/Startup.cs index bc412a4a..a880eb9f 100644 --- a/samples/Orchestration/ProcessManagerSample/Startup.cs +++ b/samples/Orchestration/ProcessManagerSample/Startup.cs @@ -20,7 +20,7 @@ public static void ConfigureServicesDelegate(HostBuilderContext context, IServic services.AddMessageBus().AddInProcessTransport(); - services.AddMediatR(typeof(GetPartnerQuery).Assembly); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestPreProcessorBehavior<,>)); //services.AddScoped, TimeoutOccuredHandler>(); diff --git a/src/Application/NBB.Application.MediatR.Effects/Mediator.cs b/src/Application/NBB.Application.MediatR.Effects/Mediator.cs index 35d91cf0..3ab9d7bc 100644 --- a/src/Application/NBB.Application.MediatR.Effects/Mediator.cs +++ b/src/Application/NBB.Application.MediatR.Effects/Mediator.cs @@ -1,88 +1,88 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using System.Threading; -using System.Threading.Tasks; -using MediatR; -using NBB.Core.Effects; -using Unit = NBB.Core.Effects.Unit; - -namespace NBB.Application.MediatR.Effects -{ - public static class MediatorEffects - { - public class Send - { - public class SideEffect : ISideEffect, IAmHandledBy> - { - public IRequest Query { get; } - - public SideEffect(IRequest query) - { - Query = query; - } - } - - - public class Handler : ISideEffectHandler, TResponse> - { - private readonly IMediator _mediator; - - public Handler(IMediator mediator) - { - _mediator = mediator; - } - - public Task Handle(SideEffect sideEffect, CancellationToken cancellationToken = default) - { - return _mediator.Send(sideEffect.Query, cancellationToken); - } - } - } - - public class Publish - { - public class SideEffect : ISideEffect - { - public INotification Notification { get; } - - public SideEffect(INotification notification) - { - Notification = notification; - } - } - - - public class Handler : ISideEffectHandler - { - private readonly IMediator _mediator; - - public Handler(IMediator mediator) - { - _mediator = mediator; - } - - public async Task Handle(SideEffect sideEffect, CancellationToken cancellationToken = default) - { - await _mediator.Publish(sideEffect.Notification, cancellationToken); - return Unit.Value; - } - } - } - } - - public static class Mediator - { - public static Effect Send(IRequest query) => - Effect.Of, TResponse>( - new MediatorEffects.Send.SideEffect(query)); - - public static Effect Send(IRequest cmd) => - Effect.Of, global::MediatR.Unit>( - new MediatorEffects.Send.SideEffect(cmd)).ToUnit(); - - public static Effect Publish(INotification notification) => - Effect.Of(new MediatorEffects.Publish.SideEffect(notification)); - - } -} +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using NBB.Core.Effects; +using Unit = NBB.Core.Effects.Unit; + +namespace NBB.Application.MediatR.Effects +{ + public static class MediatorEffects + { + public class Send + { + public class SideEffect : ISideEffect, IAmHandledBy> + { + public IRequest Query { get; } + + public SideEffect(IRequest query) + { + Query = query; + } + } + + + public class Handler : ISideEffectHandler, TResponse> + { + private readonly IMediator _mediator; + + public Handler(IMediator mediator) + { + _mediator = mediator; + } + + public Task Handle(SideEffect sideEffect, CancellationToken cancellationToken = default) + { + return _mediator.Send(sideEffect.Query, cancellationToken); + } + } + } + + public class Publish + { + public class SideEffect : ISideEffect + { + public INotification Notification { get; } + + public SideEffect(INotification notification) + { + Notification = notification; + } + } + + + public class Handler : ISideEffectHandler + { + private readonly IMediator _mediator; + + public Handler(IMediator mediator) + { + _mediator = mediator; + } + + public async Task Handle(SideEffect sideEffect, CancellationToken cancellationToken = default) + { + await _mediator.Publish(sideEffect.Notification, cancellationToken); + return Unit.Value; + } + } + } + } + + public static class Mediator + { + public static Effect Send(IRequest query) => + Effect.Of, TResponse>( + new MediatorEffects.Send.SideEffect(query)); + + //public static Effect Send(IRequest cmd) => + // Effect.Of, global::MediatR.Unit>( + // new MediatorEffects.Send.SideEffect(cmd)).ToUnit(); + + public static Effect Publish(INotification notification) => + Effect.Of(new MediatorEffects.Publish.SideEffect(notification)); + + } +} diff --git a/src/Messaging/NBB.Messaging.Host/Builder/MediatRMessagingHostExtensions.cs b/src/Messaging/NBB.Messaging.Host/Builder/MediatRMessagingHostExtensions.cs index fe0a58d6..0d3ce25a 100644 --- a/src/Messaging/NBB.Messaging.Host/Builder/MediatRMessagingHostExtensions.cs +++ b/src/Messaging/NBB.Messaging.Host/Builder/MediatRMessagingHostExtensions.cs @@ -18,7 +18,7 @@ public static class MediatorMessagingHostBuilderExtensions private record TypeInfo(Type GenericTypeDef, Func Condition); private static readonly TypeInfo EventType = new(typeof(INotificationHandler<>), _ => true); - private static readonly TypeInfo CommandType = new(typeof(IRequestHandler<,>), types => types[1] == typeof(Unit)); + private static readonly TypeInfo CommandType = new(typeof(IRequestHandler<>), _ => true); private static readonly TypeInfo QueryType = new(typeof(IRequestHandler<,>), types => types[1] != typeof(Unit)); /// diff --git a/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj b/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj index a9e2de2e..e841b7cf 100644 --- a/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj +++ b/src/Messaging/NBB.Messaging.Rusi/NBB.Messaging.Rusi.csproj @@ -1,46 +1,46 @@  - - SAK - SAK - SAK - SAK - - - - net8.0 - Rusi client transport - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - <_Parameter1>$(AssemblyName).Tests - - + + SAK + SAK + SAK + SAK + + + + net8.0 + Rusi client transport + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + <_Parameter1>$(AssemblyName).Tests + + diff --git a/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs b/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs index cdf419e3..a87fae45 100644 --- a/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs +++ b/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs @@ -1,316 +1,316 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using BenchmarkDotNet.Attributes; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using NBB.Core.Abstractions; -using NBB.EventStore.AdoNet.Migrations; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using NBB.Data.Abstractions; -using NBB.Domain; +using BenchmarkDotNet.Attributes; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using NBB.Core.Abstractions; +using NBB.EventStore.AdoNet.Migrations; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using NBB.Data.Abstractions; +using NBB.Domain; using System.Reflection; using MediatR; -namespace TheBenchmarks -{ - //[SimpleJob(runStrategy:RunStrategy.ColdStart, launchCount: 2, warmupCount: 0, targetCount: 5)] - //[SimpleJob(runStrategy:RunStrategy.ColdStart, launchCount: 10, warmupCount: 0, targetCount: 1)] - [SimpleJob(launchCount: 1, warmupCount: 0, targetCount: 10)] - [RPlotExporter, RankColumn] - public class EventSourcedRepositoryBenchmark - { - private IServiceProvider _container; +namespace TheBenchmarks +{ + //[SimpleJob(runStrategy:RunStrategy.ColdStart, launchCount: 2, warmupCount: 0, targetCount: 5)] + //[SimpleJob(runStrategy:RunStrategy.ColdStart, launchCount: 10, warmupCount: 0, targetCount: 1)] + [SimpleJob(launchCount: 1, warmupCount: 0, targetCount: 10)] + [RPlotExporter, RankColumn] + public class EventSourcedRepositoryBenchmark + { + private IServiceProvider _container; private TestAggregate _loadedAggregate; - private readonly Guid _loadTestAggregateId = Guid.NewGuid(); - - private const int _snapshotFrequency = 10; - private const bool _useJunkData = false; - private const int _junkDataAggregates = 100; - private const int _junkDataEventsPerAggregate = 1000; - - [Params(10, 100, 1000)] - public int NumberOfEvents { get; set; } - - public void GlobalSetup(bool withSnapshot) - { - MigrateNBBEventStore(); - - _container = BuildServiceProvider(services => - { - services.AddEventSourcingDataAccess((sp, builder) => builder.Options.DefaultSnapshotVersionFrequency = _snapshotFrequency); - - if (withSnapshot) - services.AddEventSourcedRepository(); - else - services.AddEventSourcedRepository(); - }); - - if (withSnapshot) - SeedEventRepository(_useJunkData); - else - SeedEventRepository(_useJunkData); - } - - [GlobalSetup(Target = nameof(LoadAggregateWithoutSnapshot))] - public void GlobalSetupLoadAggregateWithoutSnapshot() - { - GlobalSetup(false); - //LoadAggregate(); - //TryLoadRandomAggregate(); - } - - [GlobalSetup(Target = nameof(LoadAndSaveAggregateWithoutSnapshot))] - public void GlobalSetupLoadAndSaveAggregateWithoutSnapshot() - { - GlobalSetup(false); - //LoadAndSaveAggregateWithoutSnapshot(); - } - - [GlobalSetup(Target = nameof(SaveAggregateWithoutSnapshot))] - public void GlobalSetupSaveAggregateWithoutSnapshot() - { - GlobalSetup(false); - } - - [GlobalSetup(Target = nameof(LoadAggregateWithSnapshot))] - public void GlobalSetupLoadAggregateWithSnapshot() - { - GlobalSetup(true); - //LoadAggregate(); - //TryLoadRandomAggregate(); + private readonly Guid _loadTestAggregateId = Guid.NewGuid(); + + private const int _snapshotFrequency = 10; + private const bool _useJunkData = false; + private const int _junkDataAggregates = 100; + private const int _junkDataEventsPerAggregate = 1000; + + [Params(10, 100, 1000)] + public int NumberOfEvents { get; set; } + + public void GlobalSetup(bool withSnapshot) + { + MigrateNBBEventStore(); + + _container = BuildServiceProvider(services => + { + services.AddEventSourcingDataAccess((sp, builder) => builder.Options.DefaultSnapshotVersionFrequency = _snapshotFrequency); + + if (withSnapshot) + services.AddEventSourcedRepository(); + else + services.AddEventSourcedRepository(); + }); + + if (withSnapshot) + SeedEventRepository(_useJunkData); + else + SeedEventRepository(_useJunkData); } - [GlobalSetup(Target = nameof(LoadAndSaveAggregateWithSnapshot))] - public void GlobalSetupLoadAndSaveAggregateWithSnapshot() - { - GlobalSetup(true); - //LoadAndSaveAggregateWithSnapshot(); - } - - [GlobalSetup(Target = nameof(SaveAggregateWithSnapshot))] - public void GlobalSetupSaveAggregateWithSnapshot() - { - GlobalSetup(true); + [GlobalSetup(Target = nameof(LoadAggregateWithoutSnapshot))] + public void GlobalSetupLoadAggregateWithoutSnapshot() + { + GlobalSetup(false); + //LoadAggregate(); + //TryLoadRandomAggregate(); + } + + [GlobalSetup(Target = nameof(LoadAndSaveAggregateWithoutSnapshot))] + public void GlobalSetupLoadAndSaveAggregateWithoutSnapshot() + { + GlobalSetup(false); + //LoadAndSaveAggregateWithoutSnapshot(); + } + + [GlobalSetup(Target = nameof(SaveAggregateWithoutSnapshot))] + public void GlobalSetupSaveAggregateWithoutSnapshot() + { + GlobalSetup(false); + } + + [GlobalSetup(Target = nameof(LoadAggregateWithSnapshot))] + public void GlobalSetupLoadAggregateWithSnapshot() + { + GlobalSetup(true); + //LoadAggregate(); + //TryLoadRandomAggregate(); + } + + [GlobalSetup(Target = nameof(LoadAndSaveAggregateWithSnapshot))] + public void GlobalSetupLoadAndSaveAggregateWithSnapshot() + { + GlobalSetup(true); + //LoadAndSaveAggregateWithSnapshot(); + } + + [GlobalSetup(Target = nameof(SaveAggregateWithSnapshot))] + public void GlobalSetupSaveAggregateWithSnapshot() + { + GlobalSetup(true); } //[Benchmark] - public void LoadAggregateWithoutSnapshot() - { - LoadAggregate(); - } - - //[Benchmark] - public void LoadAggregateWithSnapshot() - { - LoadAggregate(); - } - - [Benchmark] - public void LoadAndSaveAggregateWithSnapshot() - { - var aggregate = LoadAggregate(); - SaveAggregate(aggregate); - } - - [Benchmark] - public void LoadAndSaveAggregateWithoutSnapshot() - { - var aggregate = LoadAggregate(); - SaveAggregate(aggregate); - } - - //[Benchmark] - public void SaveAggregateWithSnapshot() - { - SaveAggregate((TestSnapshotAggregate)_loadedAggregate); - } - - //[Benchmark] - public void SaveAggregateWithoutSnapshot() - { - SaveAggregate(_loadedAggregate); - } - - public TAggregateRoot LoadAggregate() where TAggregateRoot : TestAggregate - { - using var scope = _container.CreateScope(); - var repository = scope.ServiceProvider.GetService>(); - var aggregate = repository.GetByIdAsync(_loadTestAggregateId, default).GetAwaiter().GetResult(); - - if (aggregate?.AggregateId == default(Guid)) - aggregate.AggregateId = _loadTestAggregateId; - - return aggregate; - } - - public void TryLoadRandomAggregate() where TAggregateRoot : TestAggregate - { - using var scope = _container.CreateScope(); - var repository = scope.ServiceProvider.GetService>(); - var aggregate = repository.GetByIdAsync(Guid.NewGuid(), default).GetAwaiter().GetResult(); - } - - public void SaveAggregate(TAggregateRoot aggregate) where TAggregateRoot : TestAggregate, new() - { - using var scope = _container.CreateScope(); - var repository = scope.ServiceProvider.GetService>(); - aggregate.DoAction($"Event {Guid.NewGuid()}"); - aggregate.DoAction($"Event {Guid.NewGuid()}"); - repository.SaveAsync(aggregate).GetAwaiter().GetResult(); - _loadedAggregate = aggregate; - } - - private void SeedEventRepository(bool useJunkData = false) where TAggregateRoot : TestAggregate, new() - { - if (useJunkData) - { - SeedJunkData(); - } - - SeedAggregates(NumberOfEvents, _loadTestAggregateId); - } - - private void SeedJunkData() where TAggregateRoot : TestAggregate, new() - { - var aggregateIds = Enumerable.Range(0, _junkDataAggregates).Select(x => Guid.NewGuid()).ToArray(); - - SeedAggregates(_junkDataEventsPerAggregate, aggregateIds); - } - - private void SeedAggregates(int eventNo, params Guid[] aggregateIds) where TAggregateRoot : TestAggregate, new() - { - using var scope = _container.CreateScope(); - var repository = scope.ServiceProvider.GetService>(); - - foreach (var aggregateId in aggregateIds) - { - var aggregate = new TAggregateRoot() { AggregateId = aggregateId }; - for (int i = 0; i < eventNo; i++) - { - aggregate.DoAction($"Value {i + 1}"); - - if ((i + 1) % _snapshotFrequency == 0) - repository.SaveAsync(aggregate).GetAwaiter().GetResult(); - } - - repository.SaveAsync(aggregate).GetAwaiter().GetResult(); - - aggregate.DoAction($"AdditionlValue 1"); - aggregate.DoAction($"AdditionlValue 2"); - aggregate.DoAction($"AdditionlValue 3"); - - repository.SaveAsync(aggregate).GetAwaiter().GetResult(); - - if (aggregateId == _loadTestAggregateId) - _loadedAggregate = aggregate; - } - } - - private static void MigrateNBBEventStore() - { - new AdoNetEventStoreDatabaseMigrator().ReCreateDatabaseObjects(default).Wait(); - } - - private static TestEvent GetATestEvent() - { - return new TestEvent("Lorem ipsum"); - } - - private static IServiceProvider BuildServiceProvider(Action addEventStoreAction) - { - var configurationBuilder = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); - - var environment = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT"); - var isDevelopment = string.Equals(environment, "development", StringComparison.OrdinalIgnoreCase); - - if (isDevelopment) - { - configurationBuilder.AddUserSecrets(Assembly.GetExecutingAssembly()); - } - - var configuration = configurationBuilder.Build(); - - var services = new ServiceCollection(); - services.AddSingleton(configuration); - services.AddLogging(); - - services.AddMediatR(typeof(Program).Assembly); - + public void LoadAggregateWithoutSnapshot() + { + LoadAggregate(); + } + + //[Benchmark] + public void LoadAggregateWithSnapshot() + { + LoadAggregate(); + } + + [Benchmark] + public void LoadAndSaveAggregateWithSnapshot() + { + var aggregate = LoadAggregate(); + SaveAggregate(aggregate); + } + + [Benchmark] + public void LoadAndSaveAggregateWithoutSnapshot() + { + var aggregate = LoadAggregate(); + SaveAggregate(aggregate); + } + + //[Benchmark] + public void SaveAggregateWithSnapshot() + { + SaveAggregate((TestSnapshotAggregate)_loadedAggregate); + } + + //[Benchmark] + public void SaveAggregateWithoutSnapshot() + { + SaveAggregate(_loadedAggregate); + } + + public TAggregateRoot LoadAggregate() where TAggregateRoot : TestAggregate + { + using var scope = _container.CreateScope(); + var repository = scope.ServiceProvider.GetService>(); + var aggregate = repository.GetByIdAsync(_loadTestAggregateId, default).GetAwaiter().GetResult(); + + if (aggregate?.AggregateId == default(Guid)) + aggregate.AggregateId = _loadTestAggregateId; + + return aggregate; + } + + public void TryLoadRandomAggregate() where TAggregateRoot : TestAggregate + { + using var scope = _container.CreateScope(); + var repository = scope.ServiceProvider.GetService>(); + var aggregate = repository.GetByIdAsync(Guid.NewGuid(), default).GetAwaiter().GetResult(); + } + + public void SaveAggregate(TAggregateRoot aggregate) where TAggregateRoot : TestAggregate, new() + { + using var scope = _container.CreateScope(); + var repository = scope.ServiceProvider.GetService>(); + aggregate.DoAction($"Event {Guid.NewGuid()}"); + aggregate.DoAction($"Event {Guid.NewGuid()}"); + repository.SaveAsync(aggregate).GetAwaiter().GetResult(); + _loadedAggregate = aggregate; + } + + private void SeedEventRepository(bool useJunkData = false) where TAggregateRoot : TestAggregate, new() + { + if (useJunkData) + { + SeedJunkData(); + } + + SeedAggregates(NumberOfEvents, _loadTestAggregateId); + } + + private void SeedJunkData() where TAggregateRoot : TestAggregate, new() + { + var aggregateIds = Enumerable.Range(0, _junkDataAggregates).Select(x => Guid.NewGuid()).ToArray(); + + SeedAggregates(_junkDataEventsPerAggregate, aggregateIds); + } + + private void SeedAggregates(int eventNo, params Guid[] aggregateIds) where TAggregateRoot : TestAggregate, new() + { + using var scope = _container.CreateScope(); + var repository = scope.ServiceProvider.GetService>(); + + foreach (var aggregateId in aggregateIds) + { + var aggregate = new TAggregateRoot() { AggregateId = aggregateId }; + for (int i = 0; i < eventNo; i++) + { + aggregate.DoAction($"Value {i + 1}"); + + if ((i + 1) % _snapshotFrequency == 0) + repository.SaveAsync(aggregate).GetAwaiter().GetResult(); + } + + repository.SaveAsync(aggregate).GetAwaiter().GetResult(); + + aggregate.DoAction($"AdditionlValue 1"); + aggregate.DoAction($"AdditionlValue 2"); + aggregate.DoAction($"AdditionlValue 3"); + + repository.SaveAsync(aggregate).GetAwaiter().GetResult(); + + if (aggregateId == _loadTestAggregateId) + _loadedAggregate = aggregate; + } + } + + private static void MigrateNBBEventStore() + { + new AdoNetEventStoreDatabaseMigrator().ReCreateDatabaseObjects(default).Wait(); + } + + private static TestEvent GetATestEvent() + { + return new TestEvent("Lorem ipsum"); + } + + private static IServiceProvider BuildServiceProvider(Action addEventStoreAction) + { + var configurationBuilder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); + + var environment = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT"); + var isDevelopment = string.Equals(environment, "development", StringComparison.OrdinalIgnoreCase); + + if (isDevelopment) + { + configurationBuilder.AddUserSecrets(Assembly.GetExecutingAssembly()); + } + + var configuration = configurationBuilder.Build(); + + var services = new ServiceCollection(); + services.AddSingleton(configuration); + services.AddLogging(); + + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining()); + services.AddEventStore(es => { es.UseNewtownsoftJson(); es.UseAdoNetEventRepository(opts => opts.FromConfiguration()); - }); - - addEventStoreAction(services); - - var container = services.BuildServiceProvider(); - return container; - } - - public record TestEvent(string Prop); - - public class TestAggregate : EventSourcedAggregateRoot + }); + + addEventStoreAction(services); + + var container = services.BuildServiceProvider(); + return container; + } + + public record TestEvent(string Prop); + + public class TestAggregate : EventSourcedAggregateRoot { - public Guid AggregateId { get; set; } - + public Guid AggregateId { get; set; } + protected List State { get; set; } = new List(); - public string Prop1 { get; protected set; } - - public override Guid GetIdentityValue() - { - return AggregateId; - } - - public void DoAction(string prop) - { - Emit(new TestEvent(prop)); - } - - private void Apply(TestEvent testEvent) - { - if (State.Count > 100) - State.Clear(); - - State.Add(testEvent.Prop); - } - } - - public class TestSnapshotAggregate : TestAggregate, IMementoProvider - { - public void SetMemento(TestSnapshot memento) - { - AggregateId = memento.AggregateId; - State = memento.State.ToList(); - } - - public TestSnapshot CreateMemento() - { - return new TestSnapshot(AggregateId, State.ToList()); - } - - void IMementoProvider.SetMemento(object memento) => SetMemento((TestSnapshot)memento); - object IMementoProvider.CreateMemento() => CreateMemento(); + public string Prop1 { get; protected set; } + + public override Guid GetIdentityValue() + { + return AggregateId; + } + + public void DoAction(string prop) + { + Emit(new TestEvent(prop)); + } + + private void Apply(TestEvent testEvent) + { + if (State.Count > 100) + State.Clear(); + + State.Add(testEvent.Prop); + } + } + + public class TestSnapshotAggregate : TestAggregate, IMementoProvider + { + public void SetMemento(TestSnapshot memento) + { + AggregateId = memento.AggregateId; + State = memento.State.ToList(); + } + + public TestSnapshot CreateMemento() + { + return new TestSnapshot(AggregateId, State.ToList()); + } + + void IMementoProvider.SetMemento(object memento) => SetMemento((TestSnapshot)memento); + object IMementoProvider.CreateMemento() => CreateMemento(); } - public class TestSnapshot - { - public Guid AggregateId { get; } - public IEnumerable State { get; } - - public TestSnapshot(Guid aggregateId, IEnumerable state) - { - AggregateId = aggregateId; - State = state; - } - } - } -} + public class TestSnapshot + { + public Guid AggregateId { get; } + public IEnumerable State { get; } + + public TestSnapshot(Guid aggregateId, IEnumerable state) + { + AggregateId = aggregateId; + State = state; + } + } + } +} diff --git a/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj b/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj index 69048d39..9d1fec9c 100644 --- a/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj +++ b/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmarks.csproj @@ -34,7 +34,7 @@ - + diff --git a/test/Integration/NBB.EventStore.IntegrationTests/SnapshotStoreDBIntegrationTests.cs b/test/Integration/NBB.EventStore.IntegrationTests/SnapshotStoreDBIntegrationTests.cs index e318f4c2..e243bb61 100644 --- a/test/Integration/NBB.EventStore.IntegrationTests/SnapshotStoreDBIntegrationTests.cs +++ b/test/Integration/NBB.EventStore.IntegrationTests/SnapshotStoreDBIntegrationTests.cs @@ -1,177 +1,177 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using FluentAssertions; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Moq; -using NBB.Core.Abstractions; -using NBB.EventStore.Abstractions; -using NBB.EventStore.AdoNet.Migrations; -using NBB.MultiTenancy.Abstractions; -using NBB.MultiTenancy.Abstractions.Context; -using System; -using System.IO; +using FluentAssertions; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Moq; +using NBB.Core.Abstractions; +using NBB.EventStore.Abstractions; +using NBB.EventStore.AdoNet.Migrations; +using NBB.MultiTenancy.Abstractions; +using NBB.MultiTenancy.Abstractions.Context; +using System; +using System.IO; using System.Reflection; -using System.Threading; -using System.Threading.Tasks; -using Xunit; - -namespace NBB.EventStore.IntegrationTests -{ - [Collection("EventStoreDB")] - public class SnapshotStoreDbIntegrationTests : IClassFixture - { - [Fact] - public void Should_store_snapshot_thread_safe() - { - // Arrange - PrepareDb(); - var container = BuildAdoRepoServiceProvider(); - var stream = Guid.NewGuid().ToString(); - const int streamVersion = 0; - const int threadCount = 10; - var concurrencyExceptionCount = 0; - - using var scope = container.CreateScope(); - var snapshotStore = scope.ServiceProvider.GetService(); - - // Act - Parallel.For(0, threadCount, _ => - { - try - { - snapshotStore.StoreSnapshotAsync( - new SnapshotEnvelope( - new TestSnapshot { Prop1 = "aaa", Prop2 = "bbb" }, streamVersion, stream), - CancellationToken.None - ).GetAwaiter().GetResult(); - } - catch (ConcurrencyUnrecoverableException) - { - Interlocked.Increment(ref concurrencyExceptionCount); - } - }); - var snapshot = snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None).Result; - - // Assert - snapshot.Should().NotBeNull(); - concurrencyExceptionCount.Should().Be(threadCount - 1); - } - - [Fact] - public void Should_retrieve_snapshot_with_latest_version() - { - // Arrange - PrepareDb(); - var container = BuildAdoRepoServiceProvider(); - var stream = Guid.NewGuid().ToString(); - const int threadCount = 10; - - using var scope = container.CreateScope(); - var snapshotStore = scope.ServiceProvider.GetService(); - - // Act - Parallel.For(0, threadCount, index => - { - snapshotStore.StoreSnapshotAsync( - new SnapshotEnvelope( - new TestSnapshot { Prop1 = "aaa", Prop2 = "bbb" }, index, stream), - CancellationToken.None - ).GetAwaiter().GetResult(); - - }); - var snapshot = snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None).Result; - - // Assert - snapshot.Should().NotBeNull(); - snapshot.AggregateVersion.Should().Be(threadCount - 1); - } - - [Fact] - public async Task Should_load_stored_snapshot() - { - //Arrange - PrepareDb(); - var container = BuildAdoRepoServiceProvider(); - var stream = Guid.NewGuid().ToString(); - var snapshot = new TestSnapshot { Prop1 = "aaa", Prop2 = "bbb" }; - var snapshotEnvelope = new SnapshotEnvelope(snapshot, 1, stream); - - using var scope = container.CreateScope(); - //Act - var snapshotStore = scope.ServiceProvider.GetService(); - - await snapshotStore.StoreSnapshotAsync(snapshotEnvelope, CancellationToken.None); - - var loadedSnapshotEnvelope = await snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None); - - //Assert - loadedSnapshotEnvelope.Should().NotBeNull(); - loadedSnapshotEnvelope.Should().BeEquivalentTo(snapshotEnvelope); +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace NBB.EventStore.IntegrationTests +{ + [Collection("EventStoreDB")] + public class SnapshotStoreDbIntegrationTests : IClassFixture + { + [Fact] + public void Should_store_snapshot_thread_safe() + { + // Arrange + PrepareDb(); + var container = BuildAdoRepoServiceProvider(); + var stream = Guid.NewGuid().ToString(); + const int streamVersion = 0; + const int threadCount = 10; + var concurrencyExceptionCount = 0; + + using var scope = container.CreateScope(); + var snapshotStore = scope.ServiceProvider.GetService(); + + // Act + Parallel.For(0, threadCount, _ => + { + try + { + snapshotStore.StoreSnapshotAsync( + new SnapshotEnvelope( + new TestSnapshot { Prop1 = "aaa", Prop2 = "bbb" }, streamVersion, stream), + CancellationToken.None + ).GetAwaiter().GetResult(); + } + catch (ConcurrencyUnrecoverableException) + { + Interlocked.Increment(ref concurrencyExceptionCount); + } + }); + var snapshot = snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None).Result; + + // Assert + snapshot.Should().NotBeNull(); + concurrencyExceptionCount.Should().Be(threadCount - 1); + } + + [Fact] + public void Should_retrieve_snapshot_with_latest_version() + { + // Arrange + PrepareDb(); + var container = BuildAdoRepoServiceProvider(); + var stream = Guid.NewGuid().ToString(); + const int threadCount = 10; + + using var scope = container.CreateScope(); + var snapshotStore = scope.ServiceProvider.GetService(); + + // Act + Parallel.For(0, threadCount, index => + { + snapshotStore.StoreSnapshotAsync( + new SnapshotEnvelope( + new TestSnapshot { Prop1 = "aaa", Prop2 = "bbb" }, index, stream), + CancellationToken.None + ).GetAwaiter().GetResult(); + + }); + var snapshot = snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None).Result; + + // Assert + snapshot.Should().NotBeNull(); + snapshot.AggregateVersion.Should().Be(threadCount - 1); + } + + [Fact] + public async Task Should_load_stored_snapshot() + { + //Arrange + PrepareDb(); + var container = BuildAdoRepoServiceProvider(); + var stream = Guid.NewGuid().ToString(); + var snapshot = new TestSnapshot { Prop1 = "aaa", Prop2 = "bbb" }; + var snapshotEnvelope = new SnapshotEnvelope(snapshot, 1, stream); + + using var scope = container.CreateScope(); + //Act + var snapshotStore = scope.ServiceProvider.GetService(); + + await snapshotStore.StoreSnapshotAsync(snapshotEnvelope, CancellationToken.None); + + var loadedSnapshotEnvelope = await snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None); + + //Assert + loadedSnapshotEnvelope.Should().NotBeNull(); + loadedSnapshotEnvelope.Should().BeEquivalentTo(snapshotEnvelope); } - [Fact] - public async Task Should_return_null_for_not_found_snapshot() - { - //Arrange - PrepareDb(); - var container = BuildAdoRepoServiceProvider(); - var stream = Guid.NewGuid().ToString(); - - using var scope = container.CreateScope(); - //Act - var snapshotStore = scope.ServiceProvider.GetService(); - var loadedSnapshotEnvelope = await snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None); - - //Assert - loadedSnapshotEnvelope.Should().BeNull(); - } - - private static IServiceProvider BuildAdoRepoServiceProvider() - { - var configurationBuilder = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); - - var environment = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT"); - var isDevelopment = string.Equals(environment, "development", StringComparison.OrdinalIgnoreCase); - - if (isDevelopment) - { - configurationBuilder.AddUserSecrets(Assembly.GetExecutingAssembly()); - } - - var configuration = configurationBuilder.Build(); - - - var services = new ServiceCollection(); - services.AddSingleton(configuration); - services.AddLogging(); - + [Fact] + public async Task Should_return_null_for_not_found_snapshot() + { + //Arrange + PrepareDb(); + var container = BuildAdoRepoServiceProvider(); + var stream = Guid.NewGuid().ToString(); + + using var scope = container.CreateScope(); + //Act + var snapshotStore = scope.ServiceProvider.GetService(); + var loadedSnapshotEnvelope = await snapshotStore.LoadSnapshotAsync(stream, CancellationToken.None); + + //Assert + loadedSnapshotEnvelope.Should().BeNull(); + } + + private static IServiceProvider BuildAdoRepoServiceProvider() + { + var configurationBuilder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); + + var environment = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT"); + var isDevelopment = string.Equals(environment, "development", StringComparison.OrdinalIgnoreCase); + + if (isDevelopment) + { + configurationBuilder.AddUserSecrets(Assembly.GetExecutingAssembly()); + } + + var configuration = configurationBuilder.Build(); + + + var services = new ServiceCollection(); + services.AddSingleton(configuration); + services.AddLogging(); + services.AddEventStore(es => { es.UseNewtownsoftJson(); es.UseMultiTenantAdoNetEventRepository(opts => opts.FromConfiguration()); - }); - - services.AddMultitenancy(configuration) - .AddSingleton(Mock.Of(x => + }); + + services.AddMultitenancy(configuration) + .AddSingleton(Mock.Of(x => x.TenantContext == new TenantContext(new Tenant(Guid.NewGuid(), null, true)))); - - var container = services.BuildServiceProvider(); - return container; - } - - private static void PrepareDb() - { - new AdoNetEventStoreDatabaseMigrator(isTestHost: true).ReCreateDatabaseObjects(null).Wait(); - } - } - - public class TestSnapshot - { - public string Prop1 { get; set; } + + var container = services.BuildServiceProvider(); + return container; + } + + private static void PrepareDb() + { + new AdoNetEventStoreDatabaseMigrator(isTestHost: true).ReCreateDatabaseObjects(null).Wait(); + } + } + + public class TestSnapshot + { + public string Prop1 { get; set; } public string Prop2 { get; set; } - } -} + } +} diff --git a/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/EventSourcedRepositoryTests.cs b/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/EventSourcedRepositoryTests.cs index cf4c7fd0..db3fbcd5 100644 --- a/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/EventSourcedRepositoryTests.cs +++ b/test/UnitTests/Data/NBB.Data.EventSourcing.Tests/EventSourcedRepositoryTests.cs @@ -1,90 +1,90 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using FluentAssertions; -using MediatR; -using Microsoft.Extensions.Logging; -using Moq; -using NBB.Core.Abstractions; -using NBB.Data.EventSourcing.Infrastructure; -using NBB.Domain.Abstractions; -using NBB.EventStore.Abstractions; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Xunit; - -namespace NBB.Data.EventSourcing.Tests -{ - public class EventSourcedRepositoryTests - { - public class TestEventSourcedAggregateRoot : IEventSourcedAggregateRoot, ISnapshotableEntity - { - public TestEventSourcedAggregateRoot() - { - - } - - public TestEventSourcedAggregateRoot(Guid id, int version, List domainEvents) - { - Id = id; - Version = version; - _domainEvents = domainEvents; - - } - - public int Version { get; set; } - - private readonly List _domainEvents; - +using FluentAssertions; +using MediatR; +using Microsoft.Extensions.Logging; +using Moq; +using NBB.Core.Abstractions; +using NBB.Data.EventSourcing.Infrastructure; +using NBB.Domain.Abstractions; +using NBB.EventStore.Abstractions; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace NBB.Data.EventSourcing.Tests +{ + public class EventSourcedRepositoryTests + { + public class TestEventSourcedAggregateRoot : IEventSourcedAggregateRoot, ISnapshotableEntity + { + public TestEventSourcedAggregateRoot() + { + + } + + public TestEventSourcedAggregateRoot(Guid id, int version, List domainEvents) + { + Id = id; + Version = version; + _domainEvents = domainEvents; + + } + + public int Version { get; set; } + + private readonly List _domainEvents; + public Guid Id { get; } public int SnapshotVersion { get; protected set; } public virtual int? SnapshotVersionFrequency => null; - public virtual IEnumerable GetUncommittedChanges() => _domainEvents; - - public void LoadFromHistory(IEnumerable history) - { - //throw new NotImplementedException(); - } - - public virtual void MarkChangesAsCommitted() - { - } - - public Guid GetIdentityValue() => Id; - object IIdentifiedEntity.GetIdentityValue() => this.GetIdentityValue(); - - public string GetTypeId() - { - return "asa"; + public virtual IEnumerable GetUncommittedChanges() => _domainEvents; + + public void LoadFromHistory(IEnumerable history) + { + //throw new NotImplementedException(); + } + + public virtual void MarkChangesAsCommitted() + { + } + + public Guid GetIdentityValue() => Id; + object IIdentifiedEntity.GetIdentityValue() => this.GetIdentityValue(); + + public string GetTypeId() + { + return "asa"; } - public (object snapshot, int snapshotVersion) TakeSnapshot() - { - return (null, Version); + public (object snapshot, int snapshotVersion) TakeSnapshot() + { + return (null, Version); } public void ApplySnapshot(object snapshot, int snapshotVersion) { } - } - - public class TestSnapshotAggregateRoot : TestEventSourcedAggregateRoot, IMementoProvider - { - public TestSnapshotAggregateRoot() - { - } - - public TestSnapshotAggregateRoot(Guid id, int version, int snapshotVersion, int? snapshotVersionFrequency, List domainEvents) - : base(id, version, domainEvents) - { - SnapshotVersion = snapshotVersion; - SnapshotVersionFrequency = snapshotVersionFrequency; + } + + public class TestSnapshotAggregateRoot : TestEventSourcedAggregateRoot, IMementoProvider + { + public TestSnapshotAggregateRoot() + { + } + + public TestSnapshotAggregateRoot(Guid id, int version, int snapshotVersion, int? snapshotVersionFrequency, List domainEvents) + : base(id, version, domainEvents) + { + SnapshotVersion = snapshotVersion; + SnapshotVersionFrequency = snapshotVersionFrequency; } @@ -93,206 +93,206 @@ public void SetMemento(object snapshot) { } - public object CreateMemento() - { - return null; - } - - public override int? SnapshotVersionFrequency { get; } - } - - [Fact] - public async Task Should_save_events_in_event_store_when_aggregate_is_saved() - { - //Arrange - //var eventStoreMock = new Mock(); - var eventStoreMock = new TestEventStore(); - var sut = new EventSourcedRepository(eventStoreMock, Mock.Of(), Mock.Of(), new EventSourcingOptions(), Mock.Of>>()); - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new TestEventSourcedAggregateRoot(Guid.NewGuid(), 5, domainEvents); - - //Act - await sut.SaveAsync(testAggregate, CancellationToken.None); - - //Assert - //eventStoreMock.Verify(es => es.AppendEventsToStreamAsync(It.IsAny(), It.Is>(de=> de.Single() == domainEvent), null, It.IsAny())); - eventStoreMock.AppendEventsToStreamAsyncCallsCount.Should().Be(1); - } - - [Fact] - public async Task Should_save_snapshot_in_snapshot_store_when_aggregate_is_saved() - { - //Arrange - var snapshotStore = Mock.Of(); - var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), new EventSourcingOptions { DefaultSnapshotVersionFrequency = 1 }, Mock.Of>>()); - - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 1000, 1, 10, domainEvents); - - //Act - await sut.SaveAsync(testAggregate, CancellationToken.None); - - //Assert - Mock.Get(snapshotStore) - .Verify( - x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), - Times.Once); - } - - [Fact] - public async Task Should_not_take_snapshot_below_default_frequency() - { - //Arrange - var snapshotStore = Mock.Of(); - var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 2}; - var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); - - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 2, 1, null, domainEvents); - - //Act - await sut.SaveAsync(testAggregate, CancellationToken.None); - - //Assert - Mock.Get(snapshotStore) - .Verify( - x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), - Times.Never); - } - - [Fact] - public async Task Should_take_snapshot_at_default_frequency() - { - //Arrange - var snapshotStore = Mock.Of(); - var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 2}; - var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); - - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 3, 1, null, domainEvents); - - //Act - await sut.SaveAsync(testAggregate, CancellationToken.None); - - //Assert - Mock.Get(snapshotStore) - .Verify( - x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), - Times.Once); - } - - [Fact] - public async Task Should_not_take_snapshot_below_custom_frequency() - { - //Arrange - var snapshotStore = Mock.Of(); - var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 10}; - var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); - - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 2, 1, 2, domainEvents); - - //Act - await sut.SaveAsync(testAggregate, CancellationToken.None); - - //Assert - Mock.Get(snapshotStore) - .Verify( - x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), - Times.Never); - } - - [Fact] - public async Task Should_take_snapshot_at_custom_frequency() - { - //Arrange - var snapshotStore = Mock.Of(); - var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 10}; - var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); - - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 3, 1, 2, domainEvents); - - //Act - await sut.SaveAsync(testAggregate, CancellationToken.None); - - //Assert - Mock.Get(snapshotStore) - .Verify( - x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), - Times.Once); - } - - [Fact] - public async Task Should_mark_changes_as_committed_for_aggregate_when_aggregate_is_saved() - { - //Arrange - var eventStoreMock = new Mock(); - var sut = new EventSourcedRepository(eventStoreMock.Object, Mock.Of(), Mock.Of(), new EventSourcingOptions(), Mock.Of>>()); - var domainEvent = Mock.Of(); - var domainEvents = new List { domainEvent }; - var testAggregate = new Mock(); - testAggregate.Setup(a => a.GetUncommittedChanges()).Returns(domainEvents); - - //Act - await sut.SaveAsync(testAggregate.Object, CancellationToken.None); - - //Assert - testAggregate.Verify(a => a.MarkChangesAsCommitted(), Times.Once); - } - - [Fact] - public async Task Should_dispatch_events() - { - //Arrange - var eventStoreMock = new Mock(); - //var wasCalled = false; - //var mediatorMock = new Mock(); - //mediatorMock - // .Setup(m => m.Publish(It.IsAny(), It.IsAny())) - // .Callback(() => - // { - // wasCalled = true; - // }); - // .Returns(Task.CompletedTask); - - //.ReturnsAsync(Task.CompletedTask); //<-- return Task to allow await to continue - //mediatorMock.Setup(x=> x.Publish()) - var mediatorMock = new TestMediator(); - - var sut = new EventSourcedRepository(eventStoreMock.Object, Mock.Of(), mediatorMock, new EventSourcingOptions(), Mock.Of>>()); - var testAggregate = new Mock(); - var domainEvent = new TestDomainEvent(); - var domainEvents = new List { domainEvent }; - testAggregate.Setup(a => a.GetUncommittedChanges()).Returns(domainEvents); - //Act - await sut.SaveAsync(testAggregate.Object, CancellationToken.None); - - //Assert - //mediatorMock.Verify(m => m.Publish(domainEvent, It.IsAny()), Times.Once()); - - mediatorMock.PublishCallsCount.Should().Be(1); - - } - } - - public class TestDomainEvent : object, INotification - { - public DateTime CreationDate => DateTime.Now; - - public Guid EventId => Guid.Empty; - - public int SequenceNumber { get; set; } - } - - public class TestMediator : IMediator - { + public object CreateMemento() + { + return null; + } + + public override int? SnapshotVersionFrequency { get; } + } + + [Fact] + public async Task Should_save_events_in_event_store_when_aggregate_is_saved() + { + //Arrange + //var eventStoreMock = new Mock(); + var eventStoreMock = new TestEventStore(); + var sut = new EventSourcedRepository(eventStoreMock, Mock.Of(), Mock.Of(), new EventSourcingOptions(), Mock.Of>>()); + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new TestEventSourcedAggregateRoot(Guid.NewGuid(), 5, domainEvents); + + //Act + await sut.SaveAsync(testAggregate, CancellationToken.None); + + //Assert + //eventStoreMock.Verify(es => es.AppendEventsToStreamAsync(It.IsAny(), It.Is>(de=> de.Single() == domainEvent), null, It.IsAny())); + eventStoreMock.AppendEventsToStreamAsyncCallsCount.Should().Be(1); + } + + [Fact] + public async Task Should_save_snapshot_in_snapshot_store_when_aggregate_is_saved() + { + //Arrange + var snapshotStore = Mock.Of(); + var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), new EventSourcingOptions { DefaultSnapshotVersionFrequency = 1 }, Mock.Of>>()); + + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 1000, 1, 10, domainEvents); + + //Act + await sut.SaveAsync(testAggregate, CancellationToken.None); + + //Assert + Mock.Get(snapshotStore) + .Verify( + x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), + Times.Once); + } + + [Fact] + public async Task Should_not_take_snapshot_below_default_frequency() + { + //Arrange + var snapshotStore = Mock.Of(); + var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 2}; + var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); + + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 2, 1, null, domainEvents); + + //Act + await sut.SaveAsync(testAggregate, CancellationToken.None); + + //Assert + Mock.Get(snapshotStore) + .Verify( + x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), + Times.Never); + } + + [Fact] + public async Task Should_take_snapshot_at_default_frequency() + { + //Arrange + var snapshotStore = Mock.Of(); + var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 2}; + var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); + + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 3, 1, null, domainEvents); + + //Act + await sut.SaveAsync(testAggregate, CancellationToken.None); + + //Assert + Mock.Get(snapshotStore) + .Verify( + x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), + Times.Once); + } + + [Fact] + public async Task Should_not_take_snapshot_below_custom_frequency() + { + //Arrange + var snapshotStore = Mock.Of(); + var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 10}; + var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); + + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 2, 1, 2, domainEvents); + + //Act + await sut.SaveAsync(testAggregate, CancellationToken.None); + + //Assert + Mock.Get(snapshotStore) + .Verify( + x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), + Times.Never); + } + + [Fact] + public async Task Should_take_snapshot_at_custom_frequency() + { + //Arrange + var snapshotStore = Mock.Of(); + var options = new EventSourcingOptions {DefaultSnapshotVersionFrequency = 10}; + var sut = new EventSourcedRepository(Mock.Of(), snapshotStore, Mock.Of(), options, Mock.Of>>()); + + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new TestSnapshotAggregateRoot(Guid.NewGuid(), 3, 1, 2, domainEvents); + + //Act + await sut.SaveAsync(testAggregate, CancellationToken.None); + + //Assert + Mock.Get(snapshotStore) + .Verify( + x => x.StoreSnapshotAsync(It.IsAny(), It.IsAny()), + Times.Once); + } + + [Fact] + public async Task Should_mark_changes_as_committed_for_aggregate_when_aggregate_is_saved() + { + //Arrange + var eventStoreMock = new Mock(); + var sut = new EventSourcedRepository(eventStoreMock.Object, Mock.Of(), Mock.Of(), new EventSourcingOptions(), Mock.Of>>()); + var domainEvent = Mock.Of(); + var domainEvents = new List { domainEvent }; + var testAggregate = new Mock(); + testAggregate.Setup(a => a.GetUncommittedChanges()).Returns(domainEvents); + + //Act + await sut.SaveAsync(testAggregate.Object, CancellationToken.None); + + //Assert + testAggregate.Verify(a => a.MarkChangesAsCommitted(), Times.Once); + } + + [Fact] + public async Task Should_dispatch_events() + { + //Arrange + var eventStoreMock = new Mock(); + //var wasCalled = false; + //var mediatorMock = new Mock(); + //mediatorMock + // .Setup(m => m.Publish(It.IsAny(), It.IsAny())) + // .Callback(() => + // { + // wasCalled = true; + // }); + // .Returns(Task.CompletedTask); + + //.ReturnsAsync(Task.CompletedTask); //<-- return Task to allow await to continue + //mediatorMock.Setup(x=> x.Publish()) + var mediatorMock = new TestMediator(); + + var sut = new EventSourcedRepository(eventStoreMock.Object, Mock.Of(), mediatorMock, new EventSourcingOptions(), Mock.Of>>()); + var testAggregate = new Mock(); + var domainEvent = new TestDomainEvent(); + var domainEvents = new List { domainEvent }; + testAggregate.Setup(a => a.GetUncommittedChanges()).Returns(domainEvents); + //Act + await sut.SaveAsync(testAggregate.Object, CancellationToken.None); + + //Assert + //mediatorMock.Verify(m => m.Publish(domainEvent, It.IsAny()), Times.Once()); + + mediatorMock.PublishCallsCount.Should().Be(1); + + } + } + + public class TestDomainEvent : object, INotification + { + public DateTime CreationDate => DateTime.Now; + + public Guid EventId => Guid.Empty; + + public int SequenceNumber { get; set; } + } + + public class TestMediator : IMediator + { public int PublishCallsCount { get; private set; } public IAsyncEnumerable CreateStream(IStreamRequest request, CancellationToken cancellationToken = default) @@ -307,13 +307,13 @@ public IAsyncEnumerable CreateStream(object request, CancellationToken c public Task Publish(object notification, CancellationToken cancellationToken = default) { - this.PublishCallsCount++; + this.PublishCallsCount++; return Task.CompletedTask; } public Task Publish(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification { - this.PublishCallsCount++; + this.PublishCallsCount++; return Task.CompletedTask; } @@ -326,21 +326,26 @@ public Task Send(object request, CancellationToken cancellationToken = d { throw new NotImplementedException(); } - } - - public class TestEventStore : IEventStore - { - public int AppendEventsToStreamAsyncCallsCount { get; private set; } - - public Task AppendEventsToStreamAsync(string stream, IEnumerable events, int? expectedVersion, CancellationToken cancellationToken = default) - { - AppendEventsToStreamAsyncCallsCount++; - return Task.CompletedTask; - } - + + public Task Send(TRequest request, CancellationToken cancellationToken = default) where TRequest : IRequest + { + throw new NotImplementedException(); + } + } + + public class TestEventStore : IEventStore + { + public int AppendEventsToStreamAsyncCallsCount { get; private set; } + + public Task AppendEventsToStreamAsync(string stream, IEnumerable events, int? expectedVersion, CancellationToken cancellationToken = default) + { + AppendEventsToStreamAsyncCallsCount++; + return Task.CompletedTask; + } + public Task> GetEventsFromStreamAsync(string stream, int? startFromVersion, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } - } -} + } +} diff --git a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingHostBuilderTests.cs b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingHostBuilderTests.cs index c3c3e9bf..7ea4c800 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingHostBuilderTests.cs +++ b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingHostBuilderTests.cs @@ -50,7 +50,7 @@ public void Should_register_handled_commands_singleton() Mock.Get(services).Setup(x => x.GetEnumerator()) .Returns(new List { - new ServiceDescriptor(typeof(IRequestHandler), new CommandHandler()) + new ServiceDescriptor(typeof(IRequestHandler), new CommandHandler()) }.GetEnumerator()); //Act @@ -218,7 +218,7 @@ public class MessageToScan : MessageToScanBase public class CommandHandler : IRequestHandler { - public Task Handle(CommandMessage request, CancellationToken cancellationToken) + public Task Handle(CommandMessage request, CancellationToken cancellationToken) { throw new NotImplementedException(); } diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Extensions/TenantTokenResolverConfigurationTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Extensions/TenantTokenResolverConfigurationTests.cs index 48f8d337..f008858d 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Extensions/TenantTokenResolverConfigurationTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Extensions/TenantTokenResolverConfigurationTests.cs @@ -2,6 +2,8 @@ // This source code is licensed under the MIT license. using FluentAssertions; +using Microsoft.Extensions.DependencyInjection; +using Moq; using NBB.MultiTenancy.Identification.Extensions; using NBB.MultiTenancy.Identification.Resolvers; using System; @@ -48,7 +50,7 @@ public void Adding_Resolver_Without_Params_Should_Create_Instance() _sut.AddTenantTokenResolver(); // Act - var result = _sut.GetTenantTokenResolvers(null).ToList(); + var result = _sut.GetTenantTokenResolvers(new ServiceCollection().BuildServiceProvider()).ToList(); // Assert result.Should().NotBeNull(); @@ -66,7 +68,7 @@ public void Adding_Resolver_With_Params_Should_Create_Instance() _sut.AddTenantTokenResolver(parameter, parameter, parameter); // Act - var result = _sut.GetTenantTokenResolvers(null).ToList(); + var result = _sut.GetTenantTokenResolvers(new ServiceCollection().BuildServiceProvider()).ToList(); var args = ((MockResolver)result.First()).Args; // Assert @@ -106,7 +108,7 @@ public void Adding_Resolver_Type_Without_Params_Should_Create_Instance() _sut.AddTenantTokenResolver(typeof(MockResolver)); // Act - var result = _sut.GetTenantTokenResolvers(null).ToList(); + var result = _sut.GetTenantTokenResolvers(new ServiceCollection().BuildServiceProvider()).ToList(); // Assert result.Should().NotBeNull(); @@ -150,7 +152,7 @@ public void Adding_Resolver_Type_With_Params_Should_Create_Instance() _sut.AddTenantTokenResolver(typeof(MockResolver), parameter, parameter, parameter); // Act - var result = _sut.GetTenantTokenResolvers(null).ToList(); + var result = _sut.GetTenantTokenResolvers(new ServiceCollection().BuildServiceProvider()).ToList(); var args = ((MockResolver)result.First()).Args; // Assert @@ -179,7 +181,7 @@ public void Adding_Resolver_Instance_Should_Create_Instance() // Act _sut.AddTenantTokenResolver(resolver); - var result = _sut.GetTenantTokenResolvers(null).ToList(); + var result = _sut.GetTenantTokenResolvers(new ServiceCollection().BuildServiceProvider()).ToList(); // Assert result.Should().NotBeNull(); @@ -211,7 +213,7 @@ public void Adding_Implementation_Factory_Should_Create_Instance() // Act _sut.AddTenantTokenResolver(ImplementationFactory); - var result = _sut.GetTenantTokenResolvers(null).ToList(); + var result = _sut.GetTenantTokenResolvers(new ServiceCollection().BuildServiceProvider()).ToList(); // Assert result.Should().NotBeNull(); diff --git a/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj b/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj index 5e366a22..ac7346c0 100644 --- a/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj +++ b/test/UnitTests/Projections/NBB.ProjectR.Tests/NBB.ProjectR.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/test/UnitTests/Projections/NBB.ProjectR.Tests/TestFixture.cs b/test/UnitTests/Projections/NBB.ProjectR.Tests/TestFixture.cs index 4ef73395..fd37bf84 100644 --- a/test/UnitTests/Projections/NBB.ProjectR.Tests/TestFixture.cs +++ b/test/UnitTests/Projections/NBB.ProjectR.Tests/TestFixture.cs @@ -1,30 +1,30 @@ // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. -using MediatR; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace NBB.ProjectR.Tests -{ - public class TestFixture - { - public ServiceProvider BuildServiceProvider() - { - var services = new ServiceCollection(); - services.AddProjectR(GetType().Assembly); - services.AddMediatR(GetType().Assembly); - services - .AddEffects() - .AddMessagingEffects() - .AddMediatorEffects(); - services.AddMessageBus().AddInProcessTransport(); - services.AddEventStore(b => b.UseNewtownsoftJson().UseInMemoryEventRepository()); - services.AddLogging(); - services.AddSingleton(new ConfigurationBuilder().Build()); - - return services.BuildServiceProvider(); - - } - } -} +using MediatR; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace NBB.ProjectR.Tests +{ + public class TestFixture + { + public ServiceProvider BuildServiceProvider() + { + var services = new ServiceCollection(); + services.AddProjectR(GetType().Assembly); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(GetType().Assembly)); + services + .AddEffects() + .AddMessagingEffects() + .AddMediatorEffects(); + services.AddMessageBus().AddInProcessTransport(); + services.AddEventStore(b => b.UseNewtownsoftJson().UseInMemoryEventRepository()); + services.AddLogging(); + services.AddSingleton(new ConfigurationBuilder().Build()); + + return services.BuildServiceProvider(); + + } + } +} From 2bdd22e76d9eb0f3acfc4068b19215d23f7a9524 Mon Sep 17 00:00:00 2001 From: Lucian Ghinet Date: Fri, 24 Nov 2023 16:47:47 +0200 Subject: [PATCH 03/11] fix ci --- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9b05bb9..1316d75c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build and Test run: ./Build.ps1 shell: pwsh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5c0a4c57..0d87a663 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -62,7 +62,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - run: | dotnet build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b380301..098fbf03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build and Test run: ./Build.ps1 shell: pwsh From ad21c4b8993af2b04636b7bda23ddeb65cac83c8 Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:07:49 +0200 Subject: [PATCH 04/11] Fixed test --- .../MessagingPipeline/MediatRMiddlewareTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingPipeline/MediatRMiddlewareTests.cs b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingPipeline/MediatRMiddlewareTests.cs index f8b2a0d9..06dde174 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingPipeline/MediatRMiddlewareTests.cs +++ b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/MessagingPipeline/MediatRMiddlewareTests.cs @@ -50,7 +50,7 @@ public async void Should_sendCommandsToMediatR() await mediatRMiddleware.Invoke(new MessagingContext(envelope, string.Empty, null), default, Next); //Assert - Mock.Get(mockedMediator).Verify(x => x.Send(sentMessage, default), Times.Once); + Mock.Get(mockedMediator).Verify(x => x.Send(sentMessage, default), Times.Once); } [Fact] From f79941997191e9c165a11232733f16571a206d5d Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:18:28 +0200 Subject: [PATCH 05/11] Upgrade 3rd party libraries --- Directory.Build.props | 4 +- NBB.sln | 2 + dependencies.props | 50 ++++---- .../NBB Samples.postman_collection.json | 110 ++++++++++++++++++ .../NBB.Contracts.Api.csproj | 10 +- .../NBB.Contracts.Api/Startup.cs | 4 +- .../NBB.Contracts.Api/appsettings.json | 8 +- .../NBB.Contracts.Worker.csproj | 6 +- .../NBB.Contracts.Worker/Program.cs | 4 +- .../NBB.Contracts.Worker/appsettings.json | 5 +- .../Handlers/Common.fs | 3 +- .../NBB.Invoices.FSharp.Api.fsproj | 2 +- ...ultiTenantTodoList.postman_collection.json | 2 +- .../NBB.Todo.Api/NBB.Todo.Api.csproj | 20 ++-- samples/MultiTenancy/NBB.Todo.Api/Startup.cs | 4 +- .../NBB.Todo.Api/appsettings.json | 11 +- .../NBB.Todo.Worker/NBB.Todo.Worker.csproj | 16 +-- .../MultiTenancy/NBB.Todo.Worker/Program.cs | 4 +- .../NBB.Todo.Worker/appsettings.json | 5 +- .../ProcessManagerSample.csproj | 2 +- .../NBB.Core.DependencyInjection.csproj | 2 +- src/Domain/NBB.Domain/NBB.Domain.csproj | 2 +- .../NBB.Messaging.JetStream.csproj | 2 +- .../NBB.Messaging.Nats.csproj | 2 +- .../NBB.ProcessManager.Definition.csproj | 2 +- .../EffectsBenchmarks/EffectBenchmark.fs | 2 +- .../EventRepositoryBenchmark.cs | 2 +- .../EventSourcedRepositoryBenchmark.cs | 2 +- .../EventStoreBenchmark.cs | 2 +- ...NBB.Messaging.Rusi.IntegrationTests.csproj | 2 +- .../NBB.Core.Evented.FSharp.Tests.fsproj | 2 +- .../NBB.EventStore.AdoNet.Tests.csproj | 2 +- 32 files changed, 200 insertions(+), 96 deletions(-) create mode 100644 samples/MicroServices/NBB Samples.postman_collection.json diff --git a/Directory.Build.props b/Directory.Build.props index 03da4891..65309b49 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,8 +15,8 @@ v - - + + diff --git a/NBB.sln b/NBB.sln index 49db1ed2..beccca4e 100644 --- a/NBB.sln +++ b/NBB.sln @@ -44,6 +44,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{D282 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MicroServices", "MicroServices", "{CC43326A-DD67-4B00-80EE-C244B31A319F}" ProjectSection(SolutionItems) = preProject + samples\MicroServices\NBB Samples.postman_collection.json = samples\MicroServices\NBB Samples.postman_collection.json samples\MicroServices\README.md = samples\MicroServices\README.md EndProjectSection EndProject @@ -334,6 +335,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Messaging.DataContracts EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiTenancy", "MultiTenancy", "{FA5EB6F2-9864-46B9-B62E-13D6578D9009}" ProjectSection(SolutionItems) = preProject + samples\MultiTenancy\MultiTenantTodoList.postman_collection.json = samples\MultiTenancy\MultiTenantTodoList.postman_collection.json samples\MultiTenancy\README.md = samples\MultiTenancy\README.md EndProjectSection EndProject diff --git a/dependencies.props b/dependencies.props index 6544dbcf..010add5d 100644 --- a/dependencies.props +++ b/dependencies.props @@ -1,40 +1,40 @@  - 13.0.1 + 13.0.3 12.2.0 2.0.1 - 3.3.0 - 0.13.1 - 4.20.69 - 2.4.1 - 2.4.3 - 3.1.0 - 17.0.0 - 4.1.0 - 6.3.0 - 5.0.1 + 4.2.2 + 0.13.11 + 4.20.70 + 2.6.3 + 2.5.5 + 6.0.0 + 17.8.0 + 5.6.1 + 6.12.0 + 5.1.2 8.0.0 8.0.0 4.7.0 - 1.5.0 - 1.5.0 - 1.5.0 + 1.7.0 + 1.7.0 + 1.7.0 1.0.0-rc9.14 1.0.0-beta.7 1.0.0-rc9.14 - 1.5.0 + 1.5.1 1.5.0-rc.1 1.5.0-rc.1 - 7.2.2 - 2.10.0 - 3.1.0 - 4.0.1 - 5.6.1 - 4.1.0 - 12.0.0 - 10.6.6 - 4.17.0 + 8.2.0 + 3.1.1 + 8.0.0 + 5.0.1 + 6.5.0 + 8.0.0 + 12.0.1 + 10.9.0 + 4.18.1 1.0.3 - 6.15.0 + 7.0.3 diff --git a/samples/MicroServices/NBB Samples.postman_collection.json b/samples/MicroServices/NBB Samples.postman_collection.json new file mode 100644 index 00000000..e6d6ac04 --- /dev/null +++ b/samples/MicroServices/NBB Samples.postman_collection.json @@ -0,0 +1,110 @@ +{ + "variables": [], + "info": { + "name": "NBB Samples", + "_postman_id": "8a8a47f1-d934-e859-1450-0f113a99bacb", + "description": "", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" + }, + "item": [ + { + "name": "create contract", + "request": { + "url": "http://localhost:2047/api/contracts", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"ClientId\": \"3317223e-22ea-48dc-bc34-fff6ab3b9481\"\n}" + }, + "description": null + }, + "response": [] + }, + { + "name": "add contract line", + "request": { + "url": "http://localhost:2047/api/contracts/99534474-4560-4240-88B7-8B14E03D2733/lines", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"Product\": \"Pere\",\n \"Price\": 23,\n \"Quantity\": 5,\n \"ContractId\": \"6FD1AC92-B280-4ABC-AE7D-6ADFB2D2B5A8\"\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "validate contract", + "request": { + "url": "http://localhost:2047/api/contracts/A6159DB7-A23B-4A66-B011-B5644F0B8AED/validate", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"ContractId\": \"6FD1AC92-B280-4ABC-AE7D-6ADFB2D2B5A8\"\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "pay payable", + "request": { + "url": "http://localhost:2046/api/payables/0d64be94-9a86-4d65-b862-c401227a2292/pay", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"PayableId\": \"9C2CF598-2F3C-4617-BD29-C6C39319AE7B\"\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "get invoice", + "request": { + "url": "http://localhost:2048/api/invoices/80E80EDF-60C9-4A44-A524-522074592435", + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"ClientId\": \"3317223e-22ea-48dc-bc34-fff6ab3b9481\"\n}" + }, + "description": null + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj index 932fc344..3608ebf5 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/NBB.Contracts.Api.csproj @@ -21,7 +21,7 @@ - + @@ -29,10 +29,10 @@ - - - - + + + + diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Startup.cs b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Startup.cs index 83d510a2..57dc7621 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Startup.cs +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Startup.cs @@ -79,9 +79,9 @@ void configureResource(ResourceBuilder r) => .AddHttpClientInstrumentation() .AddAspNetCoreInstrumentation() .AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true) - .AddJaegerExporter() + .AddOtlpExporter() ); - services.Configure(Configuration.GetSection("OpenTelemetry:Jaeger")); + services.Configure(Configuration.GetSection("OpenTelemetry:Otlp")); } if (Configuration.GetValue("OpenTelemetry:MetricsEnabled")) diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/appsettings.json b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/appsettings.json index ea961e5f..03b7efe9 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/appsettings.json +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/appsettings.json @@ -30,12 +30,8 @@ "OpenTelemetry": { "MetricsEnabled": true, "TracingEnabled": true, - "Jaeger": { - //"AgentHost": "localhost", - //"AgentPort": 6831, - //"Protocol": "UdpCompactThrift", - "Endpoint": "YOUR_COLLECTOR_URL", - "Protocol": "HttpBinaryThrift" + "Otlp": { + "Endpoint": "YOUR_COLLECTOR_URL" } } } diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj index 24ebe62c..2a657132 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/NBB.Contracts.Worker.csproj @@ -31,11 +31,11 @@ - - + + - + diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs index 7ea4c03f..322b14d6 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/Program.cs @@ -92,9 +92,9 @@ void configureResource(ResourceBuilder r) => .SetSampler(new AlwaysOnSampler()) .AddMessageBusInstrumentation() .AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true) - .AddJaegerExporter() + .AddOtlpExporter() ); - services.Configure(hostingContext.Configuration.GetSection("OpenTelemetry:Jaeger")); + services.Configure(hostingContext.Configuration.GetSection("OpenTelemetry:Otlp")); } if (hostingContext.Configuration.GetValue("OpenTelemetry:MetricsEnabled")) diff --git a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/appsettings.json b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/appsettings.json index 3d4ad970..fe9b9d9c 100644 --- a/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/appsettings.json +++ b/samples/MicroServices/NBB.Contracts/NBB.Contracts.Worker/appsettings.json @@ -41,9 +41,8 @@ "OpenTelemetry": { "MetricsEnabled": true, "TracingEnabled": true, - "Jaeger": { - "Endpoint": "YOUR_COLLECTOR_URL", - "Protocol": "HttpBinaryThrift" + "Otlp": { + "Endpoint": "YOUR_COLLECTOR_URL" } } } diff --git a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Handlers/Common.fs b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Handlers/Common.fs index f6e2b9c7..9f3426a1 100644 --- a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Handlers/Common.fs +++ b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Handlers/Common.fs @@ -16,8 +16,7 @@ module MessageBus = module HandlerUtils = open Giraffe open NBB.Core.Effects - open Microsoft.AspNetCore.Http - open FSharp.Control.Tasks.Affine + open Microsoft.AspNetCore.Http open Microsoft.Extensions.DependencyInjection type Effect<'a> = FSharp.Effect<'a> diff --git a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj index 4ba43e65..000bbecf 100644 --- a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj +++ b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/NBB.Invoices.FSharp.Api.fsproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MultiTenancy/MultiTenantTodoList.postman_collection.json b/samples/MultiTenancy/MultiTenantTodoList.postman_collection.json index 5c4fd9c1..b3120b5d 100644 --- a/samples/MultiTenancy/MultiTenantTodoList.postman_collection.json +++ b/samples/MultiTenancy/MultiTenantTodoList.postman_collection.json @@ -66,4 +66,4 @@ "response": [] } ] -} \ No newline at end of file +} diff --git a/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj b/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj index 69854882..e5000e01 100644 --- a/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj +++ b/samples/MultiTenancy/NBB.Todo.Api/NBB.Todo.Api.csproj @@ -10,16 +10,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/samples/MultiTenancy/NBB.Todo.Api/Startup.cs b/samples/MultiTenancy/NBB.Todo.Api/Startup.cs index 11e54eb8..0d72d59c 100644 --- a/samples/MultiTenancy/NBB.Todo.Api/Startup.cs +++ b/samples/MultiTenancy/NBB.Todo.Api/Startup.cs @@ -76,9 +76,9 @@ void configureResource(ResourceBuilder r) => .AddAspNetCoreInstrumentation() .AddMessageBusInstrumentation() .AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true) - .AddJaegerExporter() + .AddOtlpExporter() ); - services.Configure(Configuration.GetSection("OpenTelemetry:Jaeger")); + services.Configure(Configuration.GetSection("OpenTelemetry:Otlp")); } if (Configuration.GetValue("OpenTelemetry:MetricsEnabled")) diff --git a/samples/MultiTenancy/NBB.Todo.Api/appsettings.json b/samples/MultiTenancy/NBB.Todo.Api/appsettings.json index 5ba8d6dc..2ec49cdb 100644 --- a/samples/MultiTenancy/NBB.Todo.Api/appsettings.json +++ b/samples/MultiTenancy/NBB.Todo.Api/appsettings.json @@ -1,7 +1,7 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=YOUR_SERVER;Database=NBB_Invoices;User Id=YOUR_USER;Password=YOUR_PASSWORD;MultipleActiveResultSets=true", - "Log_Database": "Server=YOUR_SERVER;Database=NBB_Invoices;User Id=YOUR_USER;Password=YOUR_PASSWORD;MultipleActiveResultSets=true" + "DefaultConnection": "Server=YOUR_SERVER;Database=NBB_Invoices;User Id=YOUR_USER;Password=YOUR_PASSWORD;MultipleActiveResultSets=true;TrustServerCertificate=True", + "Log_Database": "Server=YOUR_SERVER;Database=NBB_Invoices;User Id=YOUR_USER;Password=YOUR_PASSWORD;MultipleActiveResultSets=true;TrustServerCertificate=True" }, "Serilog": { "Properties": { @@ -64,7 +64,7 @@ "TenancyType": "MultiTenant", // "MultiTenant" "MonoTenant" "Defaults": { "ConnectionStrings": { - "DefaultConnection": "Server=YOUR_SERVER;Database=NBB_Invoices;User Id=YOUR_USER;Password=YOUR_PASSWORD;MultipleActiveResultSets=true" + "DefaultConnection": "Server=YOUR_SERVER;Database=NBB_Invoices;User Id=YOUR_USER;Password=YOUR_PASSWORD;MultipleActiveResultSets=true;TrustServerCertificate=True" } }, "Tenants": { @@ -79,9 +79,8 @@ "OpenTelemetry": { "MetricsEnabled": true, "TracingEnabled": true, - "Jaeger": { - "Endpoint": "YOUR_COLLECTOR_URL", - "Protocol": "HttpBinaryThrift" + "Otlp": { + "Endpoint": "YOUR_COLLECTOR_URL" } } } diff --git a/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj b/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj index 7583bcef..6e3f669c 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj +++ b/samples/MultiTenancy/NBB.Todo.Worker/NBB.Todo.Worker.csproj @@ -19,19 +19,19 @@ - + - - - - - - - + + + + + + + diff --git a/samples/MultiTenancy/NBB.Todo.Worker/Program.cs b/samples/MultiTenancy/NBB.Todo.Worker/Program.cs index 36efb9f0..32f72df4 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/Program.cs +++ b/samples/MultiTenancy/NBB.Todo.Worker/Program.cs @@ -121,9 +121,9 @@ void configureResource(ResourceBuilder r) => .SetSampler(new AlwaysOnSampler()) .AddMessageBusInstrumentation() .AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true) - .AddJaegerExporter() + .AddOtlpExporter() ); - services.Configure(hostingContext.Configuration.GetSection("OpenTelemetry:Jaeger")); + services.Configure(hostingContext.Configuration.GetSection("OpenTelemetry:Otlp")); } diff --git a/samples/MultiTenancy/NBB.Todo.Worker/appsettings.json b/samples/MultiTenancy/NBB.Todo.Worker/appsettings.json index f48d4608..1271db64 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/appsettings.json +++ b/samples/MultiTenancy/NBB.Todo.Worker/appsettings.json @@ -80,9 +80,8 @@ "OpenTelemetry": { "MetricsEnabled": true, "TracingEnabled": true, - "Jaeger": { - "Endpoint": "YOUR_COLLECTOR_URL", - "Protocol": "HttpBinaryThrift" + "Otlp": { + "Endpoint": "YOUR_COLLECTOR_URL" } } } diff --git a/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj b/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj index 50b70c87..bd3fcd77 100644 --- a/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj +++ b/samples/Orchestration/ProcessManagerSample/ProcessManagerSample.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj b/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj index 545685ff..8510dbcc 100644 --- a/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj +++ b/src/Core/NBB.Core.DependencyInjection/NBB.Core.DependencyInjection.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Domain/NBB.Domain/NBB.Domain.csproj b/src/Domain/NBB.Domain/NBB.Domain.csproj index b3ebd6f7..ede6a44e 100644 --- a/src/Domain/NBB.Domain/NBB.Domain.csproj +++ b/src/Domain/NBB.Domain/NBB.Domain.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj b/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj index b3058632..9b5a2db4 100644 --- a/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj +++ b/src/Messaging/NBB.Messaging.JetStream/NBB.Messaging.JetStream.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj b/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj index 00619f59..bf6ea618 100644 --- a/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj +++ b/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj b/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj index aca69f2a..76079de6 100644 --- a/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj +++ b/src/Orchestration/NBB.ProcessManager.Definition/NBB.ProcessManager.Definition.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectBenchmark.fs b/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectBenchmark.fs index bfabb434..3e556b7f 100644 --- a/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectBenchmark.fs +++ b/test/Benchmarks/EffectsBenchmarks/EffectsBenchmarks/EffectBenchmark.fs @@ -7,7 +7,7 @@ open BenchmarkDotNet.Attributes open NBB.Core.Effects.FSharp open NBB.Core.Effects.FSharp.Interpreter -[] +[] type Benchmark() = let interpreter = createInterpreter() diff --git a/test/Benchmarks/EventStoreBenchmarks/EventRepositoryBenchmark.cs b/test/Benchmarks/EventStoreBenchmarks/EventRepositoryBenchmark.cs index e542c97b..283873d2 100644 --- a/test/Benchmarks/EventStoreBenchmarks/EventRepositoryBenchmark.cs +++ b/test/Benchmarks/EventStoreBenchmarks/EventRepositoryBenchmark.cs @@ -14,7 +14,7 @@ namespace TheBenchmarks { - [SimpleJob(launchCount: 1, warmupCount: 0, targetCount: 10)] + [SimpleJob(launchCount: 1, warmupCount: 0, iterationCount: 10)] public class EventRepositoryBenchmark { private IServiceProvider _container; diff --git a/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs b/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs index a87fae45..972055ff 100644 --- a/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs +++ b/test/Benchmarks/EventStoreBenchmarks/EventSourcedRepositoryBenchmark.cs @@ -19,7 +19,7 @@ namespace TheBenchmarks { //[SimpleJob(runStrategy:RunStrategy.ColdStart, launchCount: 2, warmupCount: 0, targetCount: 5)] //[SimpleJob(runStrategy:RunStrategy.ColdStart, launchCount: 10, warmupCount: 0, targetCount: 1)] - [SimpleJob(launchCount: 1, warmupCount: 0, targetCount: 10)] + [SimpleJob(launchCount: 1, warmupCount: 0, iterationCount: 10)] [RPlotExporter, RankColumn] public class EventSourcedRepositoryBenchmark { diff --git a/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmark.cs b/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmark.cs index b6ed9167..3b2b2ae4 100644 --- a/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmark.cs +++ b/test/Benchmarks/EventStoreBenchmarks/EventStoreBenchmark.cs @@ -22,7 +22,7 @@ namespace TheBenchmarks public record TestEvent(Guid EventId, Guid? CorrelationId) : INotification; - [SimpleJob(launchCount: 1, warmupCount: 0, targetCount: 10)] + [SimpleJob(launchCount: 1, warmupCount: 0, iterationCount: 10)] public class EventStoreBenchmark { private IServiceProvider _container; diff --git a/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj b/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj index af6563c4..d8f40e0c 100644 --- a/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj +++ b/test/Integration/NBB.Messaging.Rusi.IntegrationTests/NBB.Messaging.Rusi.IntegrationTests.csproj @@ -35,7 +35,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj b/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj index b660e835..311b31bb 100644 --- a/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj +++ b/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/NBB.Core.Evented.FSharp.Tests.fsproj @@ -16,7 +16,7 @@ - + diff --git a/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj b/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj index 7fd62b10..8dc5aecb 100644 --- a/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj +++ b/test/UnitTests/EventStore/NBB.EventStore.AdoNet.Tests/NBB.EventStore.AdoNet.Tests.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From bbe978638287540da4c235118ed00850ccd8bda6 Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:30:36 +0200 Subject: [PATCH 06/11] Prerelease packages upgrade --- dependencies.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies.props b/dependencies.props index 010add5d..4e5a6821 100644 --- a/dependencies.props +++ b/dependencies.props @@ -19,12 +19,12 @@ 1.7.0 1.7.0 1.7.0 - 1.0.0-rc9.14 - 1.0.0-beta.7 - 1.0.0-rc9.14 + 1.6.0-rc.1 + 1.0.0-beta.8 + 1.6.0-rc.1 1.5.1 1.5.0-rc.1 - 1.5.0-rc.1 + 1.7.0-rc.1 8.2.0 3.1.1 8.0.0 From 6cce524c220a92cbf10e532c669f14a6cc234549 Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:33:10 +0200 Subject: [PATCH 07/11] Small refactoring --- .../NBB.Invoices.FSharp.Api/Program.fs | 2 +- samples/MultiTenancy/NBB.Todo.Api/Startup.cs | 15 ++++++- .../MultiTenancy/NBB.Todo.Worker/Program.cs | 10 ++++- .../Mediator.fs | 6 +-- .../SchemaMessageValidatorMiddleware.cs | 4 +- .../Internal/Storage.cs | 2 +- .../EventPipelineTests.fs | 6 +-- .../RequestPipelineTests.fs | 6 +-- .../NBB.Core.Evented.FSharp.Tests/Tests.fs | 4 +- .../HostedSubscriberTests.cs | 2 +- .../HostHttpTenantTokenResolverTests.cs | 19 ++++----- .../HostRefererHttpTokenResolverTests.cs | 39 ++++++++++--------- .../QueryStringTenantIdTokenResolverTests.cs | 19 ++++----- .../TenantIdHeaderHttpTokenResolverTests.cs | 19 ++++----- .../Identifiers/HostTenantIdentifierTests.cs | 8 ++-- .../Services/TenantServiceTests.cs | 4 +- .../TenantIdentificationStrategyTests.cs | 28 ++++++------- 17 files changed, 109 insertions(+), 84 deletions(-) diff --git a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Program.fs b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Program.fs index 8710dd6b..ce4d4e1e 100644 --- a/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Program.fs +++ b/samples/MicroServices/NBB.Invoices.FSharp/NBB.Invoices.FSharp.Api/Program.fs @@ -71,7 +71,7 @@ module Program = |> ignore let configureLogging (builder : ILoggingBuilder) = - builder.AddFilter(fun l -> l.Equals LogLevel.Error) + builder.AddFilter(_.Equals(LogLevel.Error)) .AddConsole() .AddDebug() |> ignore diff --git a/samples/MultiTenancy/NBB.Todo.Api/Startup.cs b/samples/MultiTenancy/NBB.Todo.Api/Startup.cs index 0d72d59c..2bed2682 100644 --- a/samples/MultiTenancy/NBB.Todo.Api/Startup.cs +++ b/samples/MultiTenancy/NBB.Todo.Api/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -23,6 +24,7 @@ using OpenTelemetry.Resources; using OpenTelemetry.Trace; using System; +using System.Linq; using System.Reflection; using ProblemDetailsOptions = Hellang.Middleware.ProblemDetails.ProblemDetailsOptions; @@ -75,7 +77,18 @@ void configureResource(ResourceBuilder r) => .AddHttpClientInstrumentation() .AddAspNetCoreInstrumentation() .AddMessageBusInstrumentation() - .AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true) + .AddEntityFrameworkCoreInstrumentation(options => + { + options.SetDbStatementForText = true; + options.EnrichWithIDbCommand = (activity, command) => + { + //activity.SetTag("db.statement", command.CommandText); + activity.SetTag( + "db.statement.params", + string.Join(", ", command.Parameters.Cast().Select(p => $"{p.ParameterName} = {p.Value}"))); + }; + + }) .AddOtlpExporter() ); services.Configure(Configuration.GetSection("OpenTelemetry:Otlp")); diff --git a/samples/MultiTenancy/NBB.Todo.Worker/Program.cs b/samples/MultiTenancy/NBB.Todo.Worker/Program.cs index 32f72df4..6dab40cc 100644 --- a/samples/MultiTenancy/NBB.Todo.Worker/Program.cs +++ b/samples/MultiTenancy/NBB.Todo.Worker/Program.cs @@ -25,6 +25,8 @@ using OpenTelemetry.Trace; using OpenTelemetry.Metrics; using NBB.Tools.Serilog.OpenTelemetryTracingSink; +using Microsoft.Data.SqlClient; +using System.Linq; namespace NBB.Todo.Worker { @@ -120,7 +122,13 @@ void configureResource(ResourceBuilder r) => .ConfigureResource(configureResource) .SetSampler(new AlwaysOnSampler()) .AddMessageBusInstrumentation() - .AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true) + .AddEntityFrameworkCoreInstrumentation(options => { + options.SetDbStatementForText = true; + options.EnrichWithIDbCommand = (activity, command) => + activity.SetTag( + "db.statement.params", + string.Join(", ", command.Parameters.Cast().Select(p => $"{p.ParameterName} = {p.Value}"))); + }) .AddOtlpExporter() ); services.Configure(hostingContext.Configuration.GetSection("OpenTelemetry:Otlp")); diff --git a/src/Application/NBB.Application.Mediator.FSharp/Mediator.fs b/src/Application/NBB.Application.Mediator.FSharp/Mediator.fs index 632da59b..7defc3a4 100644 --- a/src/Application/NBB.Application.Mediator.FSharp/Mediator.fs +++ b/src/Application/NBB.Application.Mediator.FSharp/Mediator.fs @@ -20,17 +20,17 @@ module Mediator = let dispatchEvent (event: #IEvent) = getMediator - >>= (fun mediator -> mediator.DispatchEvent(event :> IEvent)) + >>= _.DispatchEvent(event :> IEvent) let sendCommand (cmd: #ICommand) = getMediator - >>= (fun mediator -> mediator.SendCommand(cmd :> ICommand)) + >>= _.SendCommand(cmd :> ICommand) let dispatchEvents (events: #IEvent list) = List.traverse_ dispatchEvent events let sendQuery (query: #IQuery<'TResponse>) = getMediator - >>= (fun mediator -> mediator.SendQuery(query :> IQuery)) + >>= _.SendQuery(query :> IQuery) |> Effect.map unbox<'TResponse> let sendMessage message = diff --git a/src/Messaging/NBB.Messaging.Host/MessagingPipeline/SchemaMessageValidatorMiddleware.cs b/src/Messaging/NBB.Messaging.Host/MessagingPipeline/SchemaMessageValidatorMiddleware.cs index 4a767c2a..d5d9a394 100644 --- a/src/Messaging/NBB.Messaging.Host/MessagingPipeline/SchemaMessageValidatorMiddleware.cs +++ b/src/Messaging/NBB.Messaging.Host/MessagingPipeline/SchemaMessageValidatorMiddleware.cs @@ -19,10 +19,10 @@ public class SchemaMessageValidatorMiddleware : IPipelineMiddleware next) { - if (!context.MessagingEnvelope.Headers.TryGetValue(MessagingHeaders.CorrelationId, out var _)) + if (!context.MessagingEnvelope.Headers.TryGetValue(MessagingHeaders.CorrelationId, out _)) throw new Exception($"Message of type {context.MessagingEnvelope.Payload.GetType().GetPrettyName()} does not contain {MessagingHeaders.CorrelationId} header."); - if (!context.MessagingEnvelope.Headers.TryGetValue(MessagingHeaders.Source, out var _)) + if (!context.MessagingEnvelope.Headers.TryGetValue(MessagingHeaders.Source, out _)) throw new Exception($"Message of type {context.MessagingEnvelope.Payload.GetType().GetPrettyName()} does not contain {MessagingHeaders.Source} header."); await next(); diff --git a/src/Messaging/NBB.Messaging.InProcessMessaging/Internal/Storage.cs b/src/Messaging/NBB.Messaging.InProcessMessaging/Internal/Storage.cs index 6fa83fc0..90a78d62 100644 --- a/src/Messaging/NBB.Messaging.InProcessMessaging/Internal/Storage.cs +++ b/src/Messaging/NBB.Messaging.InProcessMessaging/Internal/Storage.cs @@ -57,7 +57,7 @@ public async Task AddSubscription(string topic, Func await Task.Yield(); var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - var _ = Task.Run(async () => { await StartBroker(topic, handler, cts.Token); }, cts.Token); + _ = Task.Run(async () => { await StartBroker(topic, handler, cts.Token); }, cts.Token); return new DelegateDisposable(() => { cts.Cancel(); diff --git a/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/EventPipelineTests.fs b/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/EventPipelineTests.fs index 3164d5b1..dc1a1432 100644 --- a/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/EventPipelineTests.fs +++ b/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/EventPipelineTests.fs @@ -124,7 +124,7 @@ let ``EventHandler.append left identity law `` (f: SomeEvent -> unit option) (re req |> h |> Effect.interpret interpreter - |> fun t -> t.GetAwaiter().GetResult() + |> _.GetAwaiter().GetResult() run (empty ++ f') = run f' @@ -139,7 +139,7 @@ let ``EventHandler.append right identity law`` (f: SomeEvent -> unit option) (re req |> h |> Effect.interpret interpreter - |> fun t -> t.GetAwaiter().GetResult() + |> _.GetAwaiter().GetResult() run (f' ++ empty) = run f' @@ -161,7 +161,7 @@ let ``EventHandler.append associativity law`` req |> h |> Effect.interpret interpreter - |> fun t -> t.GetAwaiter().GetResult() + |> _.GetAwaiter().GetResult() run ((f' ++ g') ++ h') = run (f' ++ (g' ++ h')) diff --git a/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/RequestPipelineTests.fs b/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/RequestPipelineTests.fs index d2501f7e..bd2c155e 100644 --- a/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/RequestPipelineTests.fs +++ b/test/UnitTests/Application/NBB.Application.Mediator.FSharp.Tests/RequestPipelineTests.fs @@ -65,7 +65,7 @@ let ``RequestHandler.compose left identity law `` (f: int -> int option) (req: i req |> h |> Effect.interpret interpreter - |> fun t -> t.GetAwaiter().GetResult() + |> _.GetAwaiter().GetResult() run (identity >=> f') = run f' @@ -78,7 +78,7 @@ let ``RequestHandler.compose right identity law`` (f: int -> int option) (req: i req |> h |> Effect.interpret interpreter - |> fun t -> t.GetAwaiter().GetResult() + |> _.GetAwaiter().GetResult() run (f' >=> identity) = run f' @@ -98,7 +98,7 @@ let ``RequestHandler.compose associativity law`` req |> h |> Effect.interpret interpreter - |> fun t -> t.GetAwaiter().GetResult() + |> _.GetAwaiter().GetResult() run ((f' >=> g') >=> h') = run (f' >=> (g' >=> h')) diff --git a/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/Tests.fs b/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/Tests.fs index ad74b7a2..fa8a2eec 100644 --- a/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/Tests.fs +++ b/test/UnitTests/Core/NBB.Core.Evented.FSharp.Tests/Tests.fs @@ -41,8 +41,8 @@ let ``Pure evented values should contain no events`` () = [] let ``List traverse evented should accumulate events`` () = let xs = [1;2] - let fn = fun i -> - match i with + let fn = + function |1 -> Evented (1,[Added]) |_ -> Evented (2,[Updated]) diff --git a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/HostedSubscriberTests.cs b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/HostedSubscriberTests.cs index ab2c894b..25fa91a9 100644 --- a/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/HostedSubscriberTests.cs +++ b/test/UnitTests/Messaging/NBB.Messaging.Host.Tests/HostedSubscriberTests.cs @@ -77,4 +77,4 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except } } } -} \ No newline at end of file +} diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostHttpTenantTokenResolverTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostHttpTenantTokenResolverTests.cs index 526645a3..c0c6ff28 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostHttpTenantTokenResolverTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostHttpTenantTokenResolverTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using Microsoft.AspNetCore.Http; using Moq; +using System.Threading.Tasks; using Xunit; namespace NBB.MultiTenancy.Identification.Http.Tests @@ -30,40 +31,40 @@ public void Should_Not_Retrieve_Context_From_Accessor_At_Constructor() // Arrange // Act - var _ = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object); + _ = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Never()); } [Fact] - public void Should_Retrieve_Context_From_Accessor() + public async Task Should_Retrieve_Context_From_Accessor() { // Arrange var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Once()); } [Fact] - public void Should_Retrieve_Request_From_Context() + public async Task Should_Retrieve_Request_From_Context() { // Arrange var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpContext.Verify(c => c.Request, Times.Once()); } [Fact] - public void Should_Retrieve_Host_From_Request() + public async Task Should_Retrieve_Host_From_Request() { // Arrange var host = new HostString("test.host"); @@ -71,14 +72,14 @@ public void Should_Retrieve_Host_From_Request() var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpRequest.Verify(i => i.Host, Times.Once()); } [Fact] - public void Should_Return_Host_Value() + public async Task Should_Return_Host_Value() { // Arrange var host = new HostString("test.host"); @@ -86,7 +87,7 @@ public void Should_Return_Host_Value() var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().Be(host.Host); diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostRefererHttpTokenResolverTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostRefererHttpTokenResolverTests.cs index 6ac13b27..f93c4b7b 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostRefererHttpTokenResolverTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/HostRefererHttpTokenResolverTests.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using Moq; +using System.Threading.Tasks; using Xunit; namespace NBB.MultiTenancy.Identification.Http.Tests @@ -35,122 +36,122 @@ public void Should_Not_Retrieve_Context_From_Accessor_At_Constructor() // Arrange // Act - var _ = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); + _ = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Never()); } [Fact] - public void Should_Retrieve_Context_From_Accessor() + public async Task Should_Retrieve_Context_From_Accessor() { // Arrange var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Once()); } [Fact] - public void Should_Retrieve_Request_From_Context() + public async Task Should_Retrieve_Request_From_Context() { // Arrange var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpContext.Verify(c => c.Request, Times.Once()); } [Fact] - public void Should_Retrieve_Header_From_Request() + public async Task Should_Retrieve_Header_From_Request() { // Arrange var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpRequest.Verify(c => c.Headers, Times.Once()); } [Fact] - public void Should_Try_To_Retrieve_HeaderReferer_From_Headers() + public async Task Should_Try_To_Retrieve_HeaderReferer_From_Headers() { // Arrange var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHeaders.Verify(h => h.TryGetValue(It.Is(key => string.Equals(key, HeaderReferer)), out It.Ref.IsAny), Times.Once()); } [Fact] - public void Should_Return_Null_If_Context_Is_Null() + public async Task Should_Return_Null_If_Context_Is_Null() { // Arrange _mockHttpContextAccessor.Setup(a => a.HttpContext).Returns((HttpContext)null); var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); } [Fact] - public void Should_Return_Null_If_Request_Is_Null() + public async Task Should_Return_Null_If_Request_Is_Null() { // Arrange _mockHttpContext.Setup(a => a.Request).Returns((HttpRequest)null); var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); } [Fact] - public void Should_Return_Null_If_Headers_Are_Null() + public async Task Should_Return_Null_If_Headers_Are_Null() { // Arrange _mockHttpRequest.Setup(a => a.Headers).Returns((IHeaderDictionary)null); var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); } [Fact] - public void Should_Return_Null_If_HeaderReferer_Does_Not_Exist() + public async Task Should_Return_Null_If_HeaderReferer_Does_Not_Exist() { // Arrange _mockHeaders.Setup(h => h.TryGetValue(It.Is(key => string.Equals(key, HeaderReferer)), out It.Ref.IsAny)).Returns(false); var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); } [Fact] - public void Should_Return_Host_From_HeaderReferer() + public async Task Should_Return_Host_From_HeaderReferer() { // Arrange const string host = "test.com"; @@ -159,7 +160,7 @@ public void Should_Return_Host_From_HeaderReferer() var sut = new HostRefererHttpTokenResolver(_mockHttpContextAccessor.Object); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().Be(host); diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/QueryStringTenantIdTokenResolverTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/QueryStringTenantIdTokenResolverTests.cs index 84819a82..bb657e86 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/QueryStringTenantIdTokenResolverTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/QueryStringTenantIdTokenResolverTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using Microsoft.AspNetCore.Http; using Moq; +using System.Threading.Tasks; using Xunit; namespace NBB.MultiTenancy.Identification.Http.Tests @@ -34,14 +35,14 @@ public void Should_Not_Retrieve_Context_From_Accessor_At_Constructor() // Arrange // Act - var _ = new QueryStringHttpTokenResolver(_mockHttpContextAccessor.Object, string.Empty); + _ = new QueryStringHttpTokenResolver(_mockHttpContextAccessor.Object, string.Empty); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Never()); } [Fact] - public void Should_Retrieve_QueryString_From_Request_From_Context_From_Accessor() + public async Task Should_Retrieve_QueryString_From_Request_From_Context_From_Accessor() { // Arrange var paramName = "name"; @@ -50,7 +51,7 @@ public void Should_Retrieve_QueryString_From_Request_From_Context_From_Accessor( var sut = new QueryStringHttpTokenResolver(_mockHttpContextAccessor.Object, paramName); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Once()); @@ -59,7 +60,7 @@ public void Should_Retrieve_QueryString_From_Request_From_Context_From_Accessor( } [Fact] - public void Should_Return_Value_From_QueryString() + public async Task Should_Return_Value_From_QueryString() { // Arrange var paramName = "name"; @@ -68,14 +69,14 @@ public void Should_Return_Value_From_QueryString() var sut = new QueryStringHttpTokenResolver(_mockHttpContextAccessor.Object, paramName); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().Be(paramValue); } [Fact] - public void Should_Return_Null_When_The_ParamName_Is_Incorrect() + public async Task Should_Return_Null_When_The_ParamName_Is_Incorrect() { // Arrange var paramName = "badName"; @@ -84,21 +85,21 @@ public void Should_Return_Null_When_The_ParamName_Is_Incorrect() var sut = new QueryStringHttpTokenResolver(_mockHttpContextAccessor.Object, "name"); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); } [Fact] - public void Should_Return_Null_If_Context_Is_Null() + public async Task Should_Return_Null_If_Context_Is_Null() { // Arrange _mockHttpContextAccessor.Setup(a => a.HttpContext).Returns((HttpContext)null); var sut = new QueryStringHttpTokenResolver(_mockHttpContextAccessor.Object, string.Empty); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/TenantIdHeaderHttpTokenResolverTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/TenantIdHeaderHttpTokenResolverTests.cs index 341bcc85..026e3b21 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/TenantIdHeaderHttpTokenResolverTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Http.Tests/TenantIdHeaderHttpTokenResolverTests.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using Moq; +using System.Threading.Tasks; using Xunit; namespace NBB.MultiTenancy.Identification.Http.Tests @@ -34,14 +35,14 @@ public void Should_Not_Retrieve_Context_From_Accessor_At_Constructor() // Arrange // Act - var _ = new HeaderHttpTokenResolver(_mockHttpContextAccessor.Object, string.Empty); + _ = new HeaderHttpTokenResolver(_mockHttpContextAccessor.Object, string.Empty); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Never()); } [Fact] - public void Should_Retrieve_Headers_From_Request_From_Context_From_Accessor() + public async Task Should_Retrieve_Headers_From_Request_From_Context_From_Accessor() { // Arrange var hKey = "key"; @@ -50,7 +51,7 @@ public void Should_Retrieve_Headers_From_Request_From_Context_From_Accessor() var sut = new HeaderHttpTokenResolver(_mockHttpContextAccessor.Object, hKey); // Act - var _ = sut.GetTenantToken().Result; + _ = await sut.GetTenantToken(); // Assert _mockHttpContextAccessor.Verify(a => a.HttpContext, Times.Once()); @@ -59,7 +60,7 @@ public void Should_Retrieve_Headers_From_Request_From_Context_From_Accessor() } [Fact] - public void Should_Return_Value_From_Header() + public async Task Should_Return_Value_From_Header() { // Arrange var hKey = "key"; @@ -68,35 +69,35 @@ public void Should_Return_Value_From_Header() var sut = new HeaderHttpTokenResolver(_mockHttpContextAccessor.Object, hKey); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().Be(hValue); } [Fact] - public void Should_Return_Null_When_The_Key_Is_Bad() + public async Task Should_Return_Null_When_The_Key_Is_Bad() { // Arrange var hKey = "bad key"; var sut = new HeaderHttpTokenResolver(_mockHttpContextAccessor.Object, hKey); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); } [Fact] - public void Should_Return_Null_If_Context_Is_Null() + public async Task Should_Return_Null_If_Context_Is_Null() { // Arrange _mockHttpContextAccessor.Setup(a => a.HttpContext).Returns((HttpContext)null); var sut = new HeaderHttpTokenResolver(_mockHttpContextAccessor.Object, string.Empty); // Act - var result = sut.GetTenantToken().Result; + var result = await sut.GetTenantToken(); // Assert result.Should().BeNull(); diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Identifiers/HostTenantIdentifierTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Identifiers/HostTenantIdentifierTests.cs index 2bd4dc91..eb0671a6 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Identifiers/HostTenantIdentifierTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Identifiers/HostTenantIdentifierTests.cs @@ -23,7 +23,7 @@ public HostTenantIdentifierTests() } [Fact] - public void Should_Return_TenantId() + public async Task Should_Return_TenantId() { // Arrange var tenantId = Guid.NewGuid(); @@ -32,14 +32,14 @@ public void Should_Return_TenantId() var sut = new HostTenantIdentifier(_tenantRepository.Object); // Act - var result = sut.GetTenantIdAsync(string.Empty).Result; + var result = await sut.GetTenantIdAsync(string.Empty); // Assert result.Should().Be(tenantId); } [Fact] - public void Should_Pass_Token_To_Repository() + public async Task Should_Pass_Token_To_Repository() { // Arrange const string tenantToken = "tenant token"; @@ -47,7 +47,7 @@ public void Should_Pass_Token_To_Repository() var sut = new HostTenantIdentifier(_tenantRepository.Object); // Act - var _ = sut.GetTenantIdAsync(tenantToken).Result; + _ = await sut.GetTenantIdAsync(tenantToken); // Assert _tenantRepository.Verify(r => r.GetByHost(It.Is(s => string.Equals(s, tenantToken)), It.IsAny()), Times.Once()); diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Services/TenantServiceTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Services/TenantServiceTests.cs index 0ec0ddfa..5707c1e8 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Services/TenantServiceTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/Services/TenantServiceTests.cs @@ -60,7 +60,7 @@ public void Should_Pass_Token_And_Stop() var sut = new DefaultTenantIdentificationService(new List() { firstPair, secondPair, thirdPair }); // Act - var _ = sut.GetTenantIdAsync().Result; + _ = sut.GetTenantIdAsync().Result; // Assert _identifier.Verify(i => i.GetTenantIdAsync(It.Is(s => string.Equals(s, tenantToken))), Times.Once()); @@ -97,7 +97,7 @@ public void Try_Method_Should_Pass_Token_And_Stop() var sut = new DefaultTenantIdentificationService(new List() { firstPair, secondPair, thirdPair }); // Act - var _ = sut.TryGetTenantIdAsync().Result; + _ = sut.TryGetTenantIdAsync().Result; // Assert _identifier.Verify(i => i.GetTenantIdAsync(It.Is(s => string.Equals(s, tenantToken))), Times.Once()); diff --git a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/TenantIdentificationStrategyTests.cs b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/TenantIdentificationStrategyTests.cs index f44ded38..2d116179 100644 --- a/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/TenantIdentificationStrategyTests.cs +++ b/test/UnitTests/MultiTenancy/NBB.MultiTenancy.Identification.Tests/TenantIdentificationStrategyTests.cs @@ -36,7 +36,7 @@ public void Should_Throw_ArgumentNullException_If_Resolvers_Are_Null() // Act Action act = () => { - var _ = new TenantIdentificationStrategy(null, identifier.Object); + _ = new TenantIdentificationStrategy(null, identifier.Object); }; // Assert @@ -52,7 +52,7 @@ public void Should_Throw_ArgumentException_If_Resolvers_Are_Empty() // Act Action act = () => { - var _ = new TenantIdentificationStrategy(new List(), identifier.Object); + _ = new TenantIdentificationStrategy(new List(), identifier.Object); }; // Assert @@ -68,7 +68,7 @@ public void Should_Throw_ArgumentNullException_If_Identifier_Is_Null() // Act Action act = () => { - var _ = new TenantIdentificationStrategy(new List() { tokenResolver.Object }, null); + _ = new TenantIdentificationStrategy(new List() { tokenResolver.Object }, null); }; // Assert @@ -76,7 +76,7 @@ public void Should_Throw_ArgumentNullException_If_Identifier_Is_Null() } [Fact] - public void Strategy_Should_Pass_Token_To_Identifier() + public async Task Strategy_Should_Pass_Token_To_Identifier() { // Arrange const string tenantToken = "mock token"; @@ -84,14 +84,14 @@ public void Strategy_Should_Pass_Token_To_Identifier() var sut = new TenantIdentificationStrategy(new List() { _firstResolver.Object, _secondResolver.Object, _thirdResolver.Object }, _identifier.Object); // Act - var _ = sut.TryGetTenantIdAsync().Result; + _ = await sut.TryGetTenantIdAsync(); // Assert _identifier.Verify(i => i.GetTenantIdAsync(It.Is(s => string.Equals(s, tenantToken))), Times.Once()); } [Fact] - public void Strategy_Should_Pass_LastToken_ToIdentifier() + public async Task Strategy_Should_Pass_LastToken_ToIdentifier() { // Arrange const string tenantToken = "mock token"; @@ -101,14 +101,14 @@ public void Strategy_Should_Pass_LastToken_ToIdentifier() var sut = new TenantIdentificationStrategy(new List() { _firstResolver.Object, _secondResolver.Object, _thirdResolver.Object }, _identifier.Object); // Act - var _ = sut.TryGetTenantIdAsync().Result; + _ = await sut.TryGetTenantIdAsync(); // Assert _identifier.Verify(i => i.GetTenantIdAsync(It.Is(s => string.Equals(s, tenantToken))), Times.Once()); } [Fact] - public void Service_Should_Return_Identifier_Result() + public async Task Service_Should_Return_Identifier_Result() { // Arrange const string tenantToken = "mock token"; @@ -118,28 +118,28 @@ public void Service_Should_Return_Identifier_Result() var sut = new TenantIdentificationStrategy(new List() { _firstResolver.Object, _secondResolver.Object, _thirdResolver.Object }, _identifier.Object); // Act - var result = sut.TryGetTenantIdAsync().Result; + var result = await sut.TryGetTenantIdAsync(); // Assert result.Should().Be(tenantId); } [Fact] - public void Should_Throw_Exception_If_Resolver_Fails_Unexpected() + public async Task Should_Throw_Exception_If_Resolver_Fails_Unexpected() { // Arrange _firstResolver.Setup(r => r.GetTenantToken()).Throws(); var sut = new TenantIdentificationStrategy(new List() { _firstResolver.Object, _secondResolver.Object, _thirdResolver.Object }, _identifier.Object); // Act - Action act = () => Task.WaitAll(sut.TryGetTenantIdAsync()); + Func act = sut.TryGetTenantIdAsync; // Assert - act.Should().Throw(); + await act.Should().ThrowAsync(); } [Fact] - public void Should_Return_Null_If_All_Resolvers_Fail() + public async Task Should_Return_Null_If_All_Resolvers_Fail() { // Arrange _firstResolver.Setup(r => r.GetTenantToken()).Returns(Task.FromResult(null)); @@ -148,7 +148,7 @@ public void Should_Return_Null_If_All_Resolvers_Fail() var sut = new TenantIdentificationStrategy(new List() { _firstResolver.Object, _secondResolver.Object, _thirdResolver.Object }, _identifier.Object); // Act - var result = sut.TryGetTenantIdAsync().Result; + var result = await sut.TryGetTenantIdAsync(); // Assert result.Should().BeNull(); From ea183e8a681c6cd3424b02e68fc8d06bed277479 Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:51:18 +0200 Subject: [PATCH 08/11] Activated Command Side Effect --- .../DependencyInjectionExtensions.cs | 3 +- .../Mediator.cs | 47 +++++++++++++++---- .../ApplicationEffectsTest.cs | 6 +-- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/Application/NBB.Application.MediatR.Effects/DependencyInjectionExtensions.cs b/src/Application/NBB.Application.MediatR.Effects/DependencyInjectionExtensions.cs index 301e352c..8476fd51 100644 --- a/src/Application/NBB.Application.MediatR.Effects/DependencyInjectionExtensions.cs +++ b/src/Application/NBB.Application.MediatR.Effects/DependencyInjectionExtensions.cs @@ -11,7 +11,8 @@ public static class DependencyInjectionExtensions { public static IServiceCollection AddMediatorEffects(this IServiceCollection services) { - services.AddSingleton(typeof(MediatorEffects.Send.Handler<>)); + services.AddSingleton(typeof(MediatorEffects.Send.QueryHandler<>)); + services.AddSingleton(typeof(MediatorEffects.Send.CommandHandler)); services.AddSingleton, MediatorEffects.Publish.Handler>(); return services; } diff --git a/src/Application/NBB.Application.MediatR.Effects/Mediator.cs b/src/Application/NBB.Application.MediatR.Effects/Mediator.cs index 3ab9d7bc..e776d0e7 100644 --- a/src/Application/NBB.Application.MediatR.Effects/Mediator.cs +++ b/src/Application/NBB.Application.MediatR.Effects/Mediator.cs @@ -13,31 +13,58 @@ public static class MediatorEffects { public class Send { - public class SideEffect : ISideEffect, IAmHandledBy> + public class QuerySideEffect : ISideEffect, IAmHandledBy> { public IRequest Query { get; } - public SideEffect(IRequest query) + public QuerySideEffect(IRequest query) { Query = query; } } + public class CommandSideEffect : ISideEffect, IAmHandledBy + { + public IRequest Query { get; } + + public CommandSideEffect(IRequest query) + { + Query = query; + } + } - public class Handler : ISideEffectHandler, TResponse> + + public class QueryHandler : ISideEffectHandler, TResponse> { private readonly IMediator _mediator; - public Handler(IMediator mediator) + public QueryHandler(IMediator mediator) { _mediator = mediator; } - public Task Handle(SideEffect sideEffect, CancellationToken cancellationToken = default) + public Task Handle(QuerySideEffect sideEffect, CancellationToken cancellationToken = default) { return _mediator.Send(sideEffect.Query, cancellationToken); } } + + public class CommandHandler : ISideEffectHandler + { + private readonly IMediator _mediator; + + public CommandHandler(IMediator mediator) + { + _mediator = mediator; + } + + public async Task Handle(CommandSideEffect sideEffect, CancellationToken cancellationToken = default) + { + await _mediator.Send(sideEffect.Query, cancellationToken); + + return Unit.Value; + } + } } public class Publish @@ -74,12 +101,12 @@ public async Task Handle(SideEffect sideEffect, CancellationToken cancella public static class Mediator { public static Effect Send(IRequest query) => - Effect.Of, TResponse>( - new MediatorEffects.Send.SideEffect(query)); + Effect.Of, TResponse>( + new MediatorEffects.Send.QuerySideEffect(query)); - //public static Effect Send(IRequest cmd) => - // Effect.Of, global::MediatR.Unit>( - // new MediatorEffects.Send.SideEffect(cmd)).ToUnit(); + public static Effect Send(IRequest cmd) => + Effect.Of( + new MediatorEffects.Send.CommandSideEffect(cmd)).ToUnit(); public static Effect Publish(INotification notification) => Effect.Of(new MediatorEffects.Publish.SideEffect(notification)); diff --git a/test/UnitTests/Application/NBB.Application.Effects.Tests/ApplicationEffectsTest.cs b/test/UnitTests/Application/NBB.Application.Effects.Tests/ApplicationEffectsTest.cs index a13ac87e..f8340231 100644 --- a/test/UnitTests/Application/NBB.Application.Effects.Tests/ApplicationEffectsTest.cs +++ b/test/UnitTests/Application/NBB.Application.Effects.Tests/ApplicationEffectsTest.cs @@ -26,7 +26,7 @@ public void AddMediatorEffects_should_register_MediatorSendQuery_SideEffectHandl //Assert using var container = services.BuildServiceProvider(); - var handler = container.GetService(typeof(MediatorEffects.Send.Handler)); + var handler = container.GetService(typeof(MediatorEffects.Send.QueryHandler)); handler.Should().NotBeNull(); } @@ -35,9 +35,9 @@ public async Task MediatorSendQuery_effect_handler_should_send_query_to_mediator { //Arrange var mediator = new Mock(); - var sut = new MediatorEffects.Send.Handler(mediator.Object); + var sut = new MediatorEffects.Send.QueryHandler(mediator.Object); var query = new TestQuery(); - var sideEffect = new MediatorEffects.Send.SideEffect(query); + var sideEffect = new MediatorEffects.Send.QuerySideEffect(query); //Act var result = await sut.Handle(sideEffect); From 91c5bb9344ce89c3ddbe4e6cca8d8013d4bae573 Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:54:55 +0200 Subject: [PATCH 09/11] Remved empty line --- src/Application/NBB.Application.MediatR.Effects/Mediator.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Application/NBB.Application.MediatR.Effects/Mediator.cs b/src/Application/NBB.Application.MediatR.Effects/Mediator.cs index e776d0e7..f79fcc25 100644 --- a/src/Application/NBB.Application.MediatR.Effects/Mediator.cs +++ b/src/Application/NBB.Application.MediatR.Effects/Mediator.cs @@ -33,7 +33,6 @@ public CommandSideEffect(IRequest query) } } - public class QueryHandler : ISideEffectHandler, TResponse> { private readonly IMediator _mediator; From 965ff2551b733bd4500afb9e5bfa5e71a69217bb Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:43:26 +0200 Subject: [PATCH 10/11] Added codeql-analisis --- NBB.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/NBB.sln b/NBB.sln index beccca4e..c8eb3f57 100644 --- a/NBB.sln +++ b/NBB.sln @@ -374,6 +374,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E7A719C2-1F6B-47DB-9708-3313EB2DBB4F}" ProjectSection(SolutionItems) = preProject .github\workflows\ci.yml = .github\workflows\ci.yml + .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml .github\workflows\release-drafter.yml = .github\workflows\release-drafter.yml .github\workflows\release.yml = .github\workflows\release.yml EndProjectSection From 1ea49f0cae495f46ecb9685a3401a40610bfa505 Mon Sep 17 00:00:00 2001 From: fraliv13 <5892139+fraliv13@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:45:39 +0200 Subject: [PATCH 11/11] Added release drafter 7.x --- .github/release-drafter-v7.x.yml | 15 +++++++++++++++ NBB.sln | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 .github/release-drafter-v7.x.yml diff --git a/.github/release-drafter-v7.x.yml b/.github/release-drafter-v7.x.yml new file mode 100644 index 00000000..efdc4234 --- /dev/null +++ b/.github/release-drafter-v7.x.yml @@ -0,0 +1,15 @@ +name-template: v$NEXT_PATCH_VERSION +tag-template: v$NEXT_PATCH_VERSION +categories: + - title: 🚀 Features + label: feature + - title: 🐛 Bug Fixes + label: fix + - title: 🛠️ Maintenance + label: chore +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +commitish: 'support/7.x' +filter-by-commitish: true +template: | + ## Changes + $CHANGES diff --git a/NBB.sln b/NBB.sln index c8eb3f57..b4fe77be 100644 --- a/NBB.sln +++ b/NBB.sln @@ -221,6 +221,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Messaging.OpenTelemetry EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F57779EB-9107-427D-A65C-5AA262C348E1}" ProjectSection(SolutionItems) = preProject + .github\release-drafter-v4.x.yml = .github\release-drafter-v4.x.yml + .github\release-drafter-v5.x.yml = .github\release-drafter-v5.x.yml + .github\release-drafter-v6.x.yml = .github\release-drafter-v6.x.yml + .github\release-drafter-v7.x.yml = .github\release-drafter-v7.x.yml .github\release-drafter.yml = .github\release-drafter.yml EndProjectSection EndProject