Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
40af7d2
Initial plan
Copilot Dec 12, 2025
0e967f1
Update target framework and package versions to .NET 10
Copilot Dec 12, 2025
372664d
Replace WithOpenApi with WithSummary and WithDescription
Copilot Dec 12, 2025
f7154a1
Remove unnecessary System.Text.Encodings.Web package references
Copilot Dec 12, 2025
61e9993
Merge branch 'main' into copilot/upgrade-chapter-4-dotnet-10
kamilbaczek Dec 19, 2025
194c11d
Update GitHub Actions workflows to use .NET 10.0.x
Copilot Jan 24, 2026
c9ef0c6
Add .NET Aspire orchestration for Fitnet and Fitnet.Contracts
Copilot Jan 24, 2026
e216d41
Enable Central Package Management and fix package source mapping
Copilot Jan 24, 2026
f48de10
Fix duplicate project reference and align package versions across sol…
Copilot Jan 24, 2026
09dcd25
Remove unnecessary Microsoft.AspNetCore.Http.Abstractions package ref…
Copilot Jan 24, 2026
e45612a
Merge branch 'main' into copilot/upgrade-chapter-4-dotnet-10
kamilbaczek Jan 24, 2026
132d5f3
Remove unnecessary System.Text.RegularExpressions package references
Copilot Jan 24, 2026
f8665c6
Remove unnecessary System.Net.Http package references
Copilot Jan 24, 2026
0391873
Remove unnecessary System.Text.Json package references
Copilot Jan 24, 2026
60b1d58
Fix Aspire workload deprecation and code formatting issues
Copilot Jan 24, 2026
fb1b8fc
Fix code formatting in Fitnet.Contracts migration files
Copilot Jan 24, 2026
85dac6d
Fix null reference warning in EventBusModule files
Copilot Jan 25, 2026
074fc82
Simplify null check in EventBusModule to fix CS8602 warning
Copilot Jan 25, 2026
0a3db9d
Add null-forgiving operator to fix CS8602 warnings in EventBusModule
Copilot Jan 25, 2026
e9fb374
Add Aspire.AppHost.Sdk to both AppHost projects
Copilot Jan 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/chapter-4-contracts-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Add Evolutionary Architecture Nuget Source
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
with:
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Add Evolutionary Architecture Nuget Source
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chapter-4-package-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Test
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Pack Projects
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chapter-4-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Add Evolutionary Architecture Nuget Source
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
with:
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Add Evolutionary Architecture Nuget Source
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>EvolutionaryArchitecture.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AnalysisLevel>latest</AnalysisLevel>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageReference Include="ErrorOr" Version="2.0.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<ItemGroup>
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>EvolutionaryArchitecture.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AnalysisLevel>latest</AnalysisLevel>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup Label="Production">
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.0.2" />
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.0.2" />
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="13.0.2" />
<PackageVersion Include="ErrorOr" Version="2.0.1" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Api" Version="4.1.7" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="4.1.7" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Infrastructure" Version="4.1.7" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.IntegrationTestsToolbox" Version="4.1.7" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.UnitTesting" Version="4.1.7" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents" Version="1.0.7" />
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.DomainDrivenDesign.BuildingBlocks" Version="1.2.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageVersion Include="MassTransit" Version="8.3.4" />
<PackageVersion Include="MassTransit.Abstractions" Version="8.3.4" />
<PackageVersion Include="MassTransit.RabbitMQ" Version="8.3.4" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
<PackageVersion Include="Microsoft.OpenApi" Version="2.3.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.0.1" />
</ItemGroup>
<ItemGroup Label="Test">
<PackageVersion Include="Bogus" Version="35.6.1" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.5.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.analyzers" Version="1.14.0" />
<PackageVersion Include="xunit.categories" Version="2.0.8" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY Directory.Build.props ./
COPY ["Fitnet.Contracts/Fitnet.Contracts.csproj", "Fitnet.Contracts/"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.1" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.analyzers" Version="1.18.0">
<PackageReference Include="Bogus" />
<PackageReference Include="Shouldly" />
<PackageReference Include="JetBrains.Annotations" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.categories" Version="2.0.8" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PackageReference Include="xunit.categories" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -28,9 +28,5 @@
<ProjectReference Include="..\Fitnet.Contracts.Api\Fitnet.Contracts.Api.csproj" />
<ProjectReference Include="..\Fitnet.Contracts.Core\Fitnet.Contracts.Core.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Fitnet.Contracts.Api\Fitnet.Contracts.Api.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ internal static void MapAttachAnnexToBindingContract(this IEndpointRouteBuilder
await contractsModule.ExecuteCommandAsync(request.ToCommand(id), cancellationToken)
.Match(annexId => Results.Created(BuildUrl(id, annexId), annexId),
errors => errors.ToProblem()))
.WithOpenApi(operation => new(operation)
{
Summary = "Attach annex to existing binding contract",
Description = "This endpoint is used to attach an annex to an existing binding contract.",
})
.WithSummary("Attach annex to existing binding contract")
.WithDescription("This endpoint is used to attach an annex to an existing binding contract.")
.Produces<string>(StatusCodes.Status201Created)
.Produces(StatusCodes.Status404NotFound)
.Produces(StatusCodes.Status409Conflict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="Microsoft.OpenApi" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ await contractsModule.ExecuteCommandAsync(request.ToCommand(), cancellationToken
contractId => Results.Created(ContractsApiPaths.GetPreparedContractPath(contractId), (object?)contractId),
errors => errors.ToProblem()))
.ValidateRequest<PrepareContractRequest>()
.WithOpenApi(operation => new(operation)
{
Summary = "Triggers preparation of a new contract for new or existing customer",
Description =
"This endpoint is used to prepare a new contract for new and existing customers.",
})
.WithSummary("Triggers preparation of a new contract for new or existing customer")
.WithDescription("This endpoint is used to prepare a new contract for new and existing customers.")
.Produces<string>(StatusCodes.Status201Created)
.Produces(StatusCodes.Status409Conflict)
.Produces(StatusCodes.Status500InternalServerError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ await contractsModule
bindingContractId => Results.Created($"/{ContractsApiPaths.BindingContracts}/{bindingContractId}",
bindingContractId), errors => errors.ToProblem()))
.ValidateRequest<SignContractRequestValidator>()
.WithOpenApi(operation => new(operation)
{
Summary = "Signs prepared contract",
Description =
"This endpoint is used to sign prepared contract by customer.",
})
.WithSummary("Signs prepared contract")
.WithDescription("This endpoint is used to sign prepared contract by customer.")
.Produces(StatusCodes.Status201Created)
.Produces(StatusCodes.Status404NotFound)
.Produces(StatusCodes.Status409Conflict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ await contractsModule.ExecuteCommandAsync(new TerminateBindingContractCommand(bi
.Match(
_ => Results.NoContent(),
errors => errors.ToProblem()))
.WithOpenApi(operation => new(operation)
{
Summary = "Terminates binding contract",
Description = "This endpoint is used to terminate an existing binding contract."
})
.WithSummary("Terminates binding contract")
.WithDescription("This endpoint is used to terminate an existing binding contract.")
.Produces(StatusCodes.Status204NoContent)
.Produces(StatusCodes.Status404NotFound)
.Produces(StatusCodes.Status409Conflict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ internal static void MapTerminateContract(this IEndpointRouteBuilder app) => app

return response;
})
.WithOpenApi(operation => new(operation)
{
Summary = "Terminate Binding Contract",
Description = "This endpoint is used to terminate a binding contract by invoking a termination.",
})
.WithSummary("Terminate Binding Contract")
.WithDescription("This endpoint is used to terminate a binding contract by invoking a termination.")
.Produces(StatusCodes.Status204NoContent)
.Produces(StatusCodes.Status404NotFound)
.Produces(StatusCodes.Status409Conflict)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Aspire.AppHost.Sdk" Version="13.0.2"/>

<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" />
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
<PackageReference Include="Aspire.Hosting.RabbitMQ" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Fitnet.Contracts\Fitnet.Contracts.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Projects;

var builder = DistributedApplication.CreateBuilder(args);

var postgres = builder.AddPostgres("postgres")
.WithImage("postgres", "14.3")
.WithPgAdmin();

var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet");

var rabbitmq = builder.AddRabbitMQ("rabbitmq")
.WithManagementPlugin();

builder.AddProject<Fitnet_Contracts>("fitnet-contracts-microservice")
.WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
.WithReference(fitnetDatabase, "Database__ConnectionString")
.WithReference(rabbitmq, "EventBus__ConnectionString")
.WaitFor(postgres)
.WaitFor(rabbitmq);

await builder.Build().RunAsync();
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.DistributedApplication": "Information"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="ErrorOr" Version="2.0.1" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Api" Version="4.1.6" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents" Version="1.0.7" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="MassTransit.Abstractions" Version="8.3.4" />
<PackageReference Include="MediatR" Version="12.3.0" />
<PackageReference Include="ErrorOr" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Api" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents" />
<PackageReference Include="JetBrains.Annotations" />
<PackageReference Include="MassTransit.Abstractions" />
<PackageReference Include="MediatR" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fitnet.Contracts.Core\Fitnet.Contracts.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.1" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="4.1.7" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.UnitTesting" Version="4.1.7" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.analyzers" Version="1.14.0">
<PackageReference Include="Bogus" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.Core" />
<PackageReference Include="EvolutionaryArchitecture.Fitnet.Common.UnitTesting" />
<PackageReference Include="Shouldly" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.categories" Version="2.0.8" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit.categories" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Loading