Skip to content

Commit 8d071d1

Browse files
committed
Epic: Upgrade to .NET 9
1 parent a5606fa commit 8d071d1

File tree

313 files changed

+4631
-8177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+4631
-8177
lines changed

.config/dotnet-tools.json

+17-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,31 @@
44
"tools": {
55
"aspirate": {
66
"version": "8.0.7",
7-
"commands": ["aspirate"],
7+
"commands": [
8+
"aspirate"
9+
],
810
"rollForward": false
911
},
1012
"dotnet-reportgenerator-globaltool": {
1113
"version": "5.3.9",
12-
"commands": ["reportgenerator"],
14+
"commands": [
15+
"reportgenerator"
16+
],
1317
"rollForward": false
1418
},
1519
"husky": {
1620
"version": "0.7.1",
17-
"commands": ["husky"],
21+
"commands": [
22+
"husky"
23+
],
24+
"rollForward": false
25+
},
26+
"csharpier": {
27+
"version": "0.30.2",
28+
"commands": [
29+
"dotnet-csharpier"
30+
],
1831
"rollForward": false
1932
}
2033
}
21-
}
34+
}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

6+
# JetBrains Rider
7+
8+
.idea/
9+
610
# Libs
711

812
dist/

BookWorm.sln

-28
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Core", "src\BookWo
4444
EndProject
4545
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Basket.UnitTests", "tests\BookWorm.Basket.UnitTests\BookWorm.Basket.UnitTests.csproj", "{CC555BD5-F8F3-4D19-93D2-65CE571BCCA5}"
4646
EndProject
47-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Basket.IntegrationTests", "tests\BookWorm.Basket.IntegrationTests\BookWorm.Basket.IntegrationTests.csproj", "{AB036927-EF20-4FF1-AD27-5CF9FA00B99C}"
48-
EndProject
4947
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Catalog.UnitTests", "tests\BookWorm.Catalog.UnitTests\BookWorm.Catalog.UnitTests.csproj", "{CDCCDF68-F4D5-43E2-9DCA-BBA51474253D}"
5048
EndProject
5149
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Ordering.UnitTests", "tests\BookWorm.Ordering.UnitTests\BookWorm.Ordering.UnitTests.csproj", "{BCE1C1F7-7640-4DE0-B637-62F2D978D9ED}"
5250
EndProject
5351
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Rating.UnitTests", "tests\BookWorm.Rating.UnitTests\BookWorm.Rating.UnitTests.csproj", "{7ED9C7E4-9EA2-4B94-82AD-FF23E35E3A57}"
5452
EndProject
55-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Catalog.IntegrationTests", "tests\BookWorm.Catalog.IntegrationTests\BookWorm.Catalog.IntegrationTests.csproj", "{1E2C8C9F-4527-4D3E-8485-3061C3CDF96C}"
56-
EndProject
57-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Ordering.IntegrationTests", "tests\BookWorm.Ordering.IntegrationTests\BookWorm.Ordering.IntegrationTests.csproj", "{0628F576-C5BC-4075-B4E4-A1550346B1FE}"
58-
EndProject
59-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Rating.IntegrationTests", "tests\BookWorm.Rating.IntegrationTests\BookWorm.Rating.IntegrationTests.csproj", "{30BF0E11-5721-4817-9DF6-A5FFC9829D27}"
60-
EndProject
6153
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Notification", "Notification", "{8AFA71A3-11DC-42A3-B5C4-94B42E8EB4F8}"
6254
EndProject
6355
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookWorm.Notification", "src\BookWorm.Notification\BookWorm.Notification.csproj", "{CFDA50FF-1E1B-4E04-AEE6-02C8163992B2}"
@@ -116,10 +108,6 @@ Global
116108
{CC555BD5-F8F3-4D19-93D2-65CE571BCCA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
117109
{CC555BD5-F8F3-4D19-93D2-65CE571BCCA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
118110
{CC555BD5-F8F3-4D19-93D2-65CE571BCCA5}.Release|Any CPU.Build.0 = Release|Any CPU
119-
{AB036927-EF20-4FF1-AD27-5CF9FA00B99C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
120-
{AB036927-EF20-4FF1-AD27-5CF9FA00B99C}.Debug|Any CPU.Build.0 = Debug|Any CPU
121-
{AB036927-EF20-4FF1-AD27-5CF9FA00B99C}.Release|Any CPU.ActiveCfg = Release|Any CPU
122-
{AB036927-EF20-4FF1-AD27-5CF9FA00B99C}.Release|Any CPU.Build.0 = Release|Any CPU
123111
{CDCCDF68-F4D5-43E2-9DCA-BBA51474253D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
124112
{CDCCDF68-F4D5-43E2-9DCA-BBA51474253D}.Debug|Any CPU.Build.0 = Debug|Any CPU
125113
{CDCCDF68-F4D5-43E2-9DCA-BBA51474253D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -132,18 +120,6 @@ Global
132120
{7ED9C7E4-9EA2-4B94-82AD-FF23E35E3A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
133121
{7ED9C7E4-9EA2-4B94-82AD-FF23E35E3A57}.Release|Any CPU.ActiveCfg = Release|Any CPU
134122
{7ED9C7E4-9EA2-4B94-82AD-FF23E35E3A57}.Release|Any CPU.Build.0 = Release|Any CPU
135-
{1E2C8C9F-4527-4D3E-8485-3061C3CDF96C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
136-
{1E2C8C9F-4527-4D3E-8485-3061C3CDF96C}.Debug|Any CPU.Build.0 = Debug|Any CPU
137-
{1E2C8C9F-4527-4D3E-8485-3061C3CDF96C}.Release|Any CPU.ActiveCfg = Release|Any CPU
138-
{1E2C8C9F-4527-4D3E-8485-3061C3CDF96C}.Release|Any CPU.Build.0 = Release|Any CPU
139-
{0628F576-C5BC-4075-B4E4-A1550346B1FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
140-
{0628F576-C5BC-4075-B4E4-A1550346B1FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
141-
{0628F576-C5BC-4075-B4E4-A1550346B1FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
142-
{0628F576-C5BC-4075-B4E4-A1550346B1FE}.Release|Any CPU.Build.0 = Release|Any CPU
143-
{30BF0E11-5721-4817-9DF6-A5FFC9829D27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
144-
{30BF0E11-5721-4817-9DF6-A5FFC9829D27}.Debug|Any CPU.Build.0 = Debug|Any CPU
145-
{30BF0E11-5721-4817-9DF6-A5FFC9829D27}.Release|Any CPU.ActiveCfg = Release|Any CPU
146-
{30BF0E11-5721-4817-9DF6-A5FFC9829D27}.Release|Any CPU.Build.0 = Release|Any CPU
147123
{CFDA50FF-1E1B-4E04-AEE6-02C8163992B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
148124
{CFDA50FF-1E1B-4E04-AEE6-02C8163992B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
149125
{CFDA50FF-1E1B-4E04-AEE6-02C8163992B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -187,13 +163,9 @@ Global
187163
{C108BCF7-3CFB-48F8-AB7E-5B4A0201C946} = {659FC2E9-B081-445A-8B49-3FDCE681BB8E}
188164
{3C3989D7-C713-47CB-9CCC-E656E488DDBD} = {5E13A8D9-B0C4-4388-A99D-AEF14B63CA8C}
189165
{CC555BD5-F8F3-4D19-93D2-65CE571BCCA5} = {84EF1604-03F3-4AE4-A216-71CE402C5C2E}
190-
{AB036927-EF20-4FF1-AD27-5CF9FA00B99C} = {84EF1604-03F3-4AE4-A216-71CE402C5C2E}
191166
{CDCCDF68-F4D5-43E2-9DCA-BBA51474253D} = {FB7C39D0-C46D-451D-AC93-E8D124695E1F}
192167
{BCE1C1F7-7640-4DE0-B637-62F2D978D9ED} = {05D7159D-A792-410B-ABB3-F36B59B6E9E2}
193168
{7ED9C7E4-9EA2-4B94-82AD-FF23E35E3A57} = {C108BCF7-3CFB-48F8-AB7E-5B4A0201C946}
194-
{1E2C8C9F-4527-4D3E-8485-3061C3CDF96C} = {FB7C39D0-C46D-451D-AC93-E8D124695E1F}
195-
{0628F576-C5BC-4075-B4E4-A1550346B1FE} = {05D7159D-A792-410B-ABB3-F36B59B6E9E2}
196-
{30BF0E11-5721-4817-9DF6-A5FFC9829D27} = {C108BCF7-3CFB-48F8-AB7E-5B4A0201C946}
197169
{8AFA71A3-11DC-42A3-B5C4-94B42E8EB4F8} = {659FC2E9-B081-445A-8B49-3FDCE681BB8E}
198170
{CFDA50FF-1E1B-4E04-AEE6-02C8163992B2} = {8AFA71A3-11DC-42A3-B5C4-94B42E8EB4F8}
199171
{3BFD59BB-A161-496C-9AD6-F2CC87047EFB} = {5E13A8D9-B0C4-4388-A99D-AEF14B63CA8C}

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<Nullable>enable</Nullable>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<InvariantGlobalization>false</InvariantGlobalization>

Directory.Packages.props

+21-31
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
5-
<AspireVersion>8.2.0</AspireVersion>
6-
<AspirantVersion>0.0.4</AspirantVersion>
7-
<MicrosoftExtensionsVersion>8.9.1</MicrosoftExtensionsVersion>
8-
<AspnetVersion>8.0.8</AspnetVersion>
9-
<EfCoreVersion>8.0.8</EfCoreVersion>
5+
<AspireVersion>9.0.0</AspireVersion>
6+
<MicrosoftExtensionsVersion>9.0.0</MicrosoftExtensionsVersion>
7+
<AspnetVersion>9.0.0</AspnetVersion>
8+
<EfCoreVersion>9.0.0</EfCoreVersion>
109
<XabarilVersion>8.0.1</XabarilVersion>
1110
<ApiVersioningVersion>8.1.0</ApiVersioningVersion>
12-
<PollyVersion>8.4.1</PollyVersion>
13-
<AspireUnstablePackagesVersion>8.2.0-preview.1.24428.5</AspireUnstablePackagesVersion>
14-
<GrpcVersion>2.65.0</GrpcVersion>
15-
<MassTransitVersion>8.2.5</MassTransitVersion>
11+
<PollyVersion>8.5.0</PollyVersion>
12+
<AspireUnstablePackagesVersion>9.0.0-preview.5.24551.3</AspireUnstablePackagesVersion>
13+
<GrpcVersion>2.67.0</GrpcVersion>
14+
<MassTransitVersion>8.3.2</MassTransitVersion>
1615
</PropertyGroup>
1716
<ItemGroup>
1817
<!-- Aspire -->
@@ -30,10 +29,6 @@
3029
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="$(MicrosoftExtensionsVersion)" />
3130
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="$(AspireVersion)" />
3231
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="$(AspireVersion)" />
33-
<!-- Aspirant -->
34-
<PackageVersion Include="Aspirant.Hosting" Version="$(AspirantVersion)" />
35-
<PackageVersion Include="Aspirant.Hosting.Testing" Version="$(AspirantVersion)" />
36-
<PackageVersion Include="Aspirant.Hosting.Testing.xunit" Version="$(AspirantVersion)" />
3732
<!-- ASP.NET Core -->
3833
<PackageVersion Include="Asp.Versioning.Http.Client" Version="$(ApiVersioningVersion)" />
3934
<PackageVersion Include="Asp.Versioning.Mvc" Version="$(ApiVersioningVersion)" />
@@ -49,41 +44,37 @@
4944
<!-- Entity Framework Core -->
5045
<PackageVersion Include="Pgvector.EntityFrameworkCore" Version="0.2.1" />
5146
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(EfCoreVersion)" />
52-
<PackageVersion Include="EFCore.NamingConventions" Version="8.0.3" />
5347
<PackageVersion Include="EntityFrameworkCore.Exceptions.Common" Version="8.1.3" />
5448
<PackageVersion Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="8.1.3" />
55-
<!-- Semantic Kernel -->
56-
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.20.0" />
5749
<!-- Polly -->
5850
<PackageVersion Include="Polly" Version="$(PollyVersion)" />
5951
<PackageVersion Include="Polly.Extensions" Version="$(PollyVersion)" />
6052
<!-- Ardalis -->
61-
<PackageVersion Include="Ardalis.GuardClauses" Version="4.6.0" />
62-
<PackageVersion Include="Ardalis.Result.AspNetCore" Version="10.0.0" />
53+
<PackageVersion Include="Ardalis.GuardClauses" Version="5.0.0" />
54+
<PackageVersion Include="Ardalis.Result.AspNetCore" Version="10.1.0" />
6355
<PackageVersion Include="Ardalis.Specification" Version="8.0.0" />
6456
<PackageVersion Include="Ardalis.Specification.EntityFrameworkCore" Version="8.0.0" />
6557
<!-- OpenTelemetry -->
66-
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
67-
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
58+
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
59+
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
6860
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
6961
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
7062
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
7163
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.9.0-beta.1" />
7264
<!-- Dunde -->
7365
<PackageVersion Include="Duende.BFF.Yarp" Version="2.2.0" />
74-
<PackageVersion Include="Duende.IdentityServer.AspNetIdentity" Version="7.0.6" />
66+
<PackageVersion Include="Duende.IdentityServer.AspNetIdentity" Version="7.0.8" />
7567
<!-- Xabaril -->
7668
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="$(XabarilVersion)" />
7769
<!-- Testing -->
78-
<PackageVersion Include="xunit" Version="2.9.0" />
70+
<PackageVersion Include="xunit" Version="2.9.2" />
7971
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
8072
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
8173
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
82-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
74+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
8375
<PackageVersion Include="Moq" Version="4.20.72" />
8476
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.4" />
85-
<PackageVersion Include="ReportGenerator" Version="5.3.9" />
86-
<PackageVersion Include="WireMock.Net.Aspire" Version="1.6.3" />
77+
<PackageVersion Include="ReportGenerator" Version="5.4.1" />
8778
<!-- Grpc -->
8879
<PackageVersion Include="Grpc.AspNetCore" Version="$(GrpcVersion)" />
8980
<PackageVersion Include="Grpc.AspNetCore.Server.ClientFactory" Version="$(GrpcVersion)" />
@@ -94,15 +85,14 @@
9485
<PackageVersion Include="MassTransit.MongoDb" Version="$(MassTransitVersion)" />
9586
<PackageVersion Include="MassTransit.EntityFrameworkCore" Version="$(MassTransitVersion)" />
9687
<!-- Miscellaneous -->
97-
<PackageVersion Include="Scrutor" Version="4.2.2" />
88+
<PackageVersion Include="Scrutor" Version="5.0.2" />
9889
<PackageVersion Include="MediatR" Version="12.4.1" />
99-
<PackageVersion Include="MongoDB.Bson" Version="2.29.0" />
100-
<PackageVersion Include="Marten.AspNetCore" Version="7.28.0" />
90+
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
91+
<PackageVersion Include="Marten.AspNetCore" Version="7.33.0" />
10192
<PackageVersion Include="FluentEmail.Mailtrap" Version="2.7.0" />
102-
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.7.3" />
103-
<PackageVersion Include="Swashbuckle.AspNetCore.ReDoc" Version="6.7.3" />
93+
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.30.0" />
94+
<PackageVersion Include="Scalar.AspNetCore" Version="1.2.44" />
10495
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
10596
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
106-
<PackageVersion Include="MicroElements.Swashbuckle.FluentValidation" Version="6.0.0" />
10797
</ItemGroup>
10898
</Project>

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- [x] CI/CD with `GitHub Actions`
3030
- [x] Testing
3131
- [x] Service unit tests
32-
- [ ] Integration tests with `Aspire Testing` & `WireMock`
32+
- [ ] Integration tests with `TestContainers`
3333
- [ ] Output Caching, Response Caching and Distributed Caching with Redis
3434
- [ ] Deployment with `Aspirate` on `k3d`
3535
- [ ] EDA document with `EventCatalog`
@@ -49,7 +49,7 @@
4949

5050
### Prerequisites
5151

52-
- [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
52+
- [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0)
5353
- [Docker](https://www.docker.com/products/docker-desktop)
5454
- [Gitleaks](https://gitleaks.io/)
5555

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.200",
3+
"version": "9.0.100",
44
"rollForward": "major",
55
"allowPrerelease": true
66
}
+9-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
2+
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
4+
35
<PropertyGroup>
46
<OutputType>Exe</OutputType>
57
<IsAspireHost>true</IsAspireHost>
68
<UserSecretsId>78a33324-5add-4731-b2fc-e0fc06ef0564</UserSecretsId>
79
</PropertyGroup>
8-
10+
911
<ItemGroup>
10-
<PackageReference Include="Aspirant.Hosting" />
1112
<PackageReference Include="Aspire.Hosting.AppHost" />
1213
<PackageReference Include="Aspire.Hosting.Azure.Storage" />
1314
<PackageReference Include="Aspire.Hosting.MongoDB" />
1415
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
1516
<PackageReference Include="Aspire.Hosting.RabbitMQ" />
1617
<PackageReference Include="Aspire.Hosting.Redis" />
1718
</ItemGroup>
18-
19+
1920
<ItemGroup>
2021
<ProjectReference Include="..\BookWorm.Basket\BookWorm.Basket.csproj" />
2122
<ProjectReference Include="..\BookWorm.Catalog\BookWorm.Catalog.csproj" />
@@ -25,13 +26,11 @@
2526
<ProjectReference Include="..\BookWorm.Ordering\BookWorm.Ordering.csproj" />
2627
<ProjectReference Include="..\BookWorm.Rating\BookWorm.Rating.csproj" />
2728
</ItemGroup>
28-
29+
2930
<ItemGroup>
3031
<ProjectReference Include="..\BookWorm.Constants\BookWorm.Constants.csproj" IsAspireProjectResource="false" />
31-
<ProjectReference Include="..\BookWorm.HealthCheck.Hosting\BookWorm.HealthCheck.Hosting.csproj"
32-
IsAspireProjectResource="false" />
33-
<ProjectReference Include="..\BookWorm.MailDev.Hosting\BookWorm.MailDev.Hosting.csproj"
34-
IsAspireProjectResource="false" />
32+
<ProjectReference Include="..\BookWorm.HealthCheck.Hosting\BookWorm.HealthCheck.Hosting.csproj" IsAspireProjectResource="false" />
33+
<ProjectReference Include="..\BookWorm.MailDev.Hosting\BookWorm.MailDev.Hosting.csproj" IsAspireProjectResource="false" />
3534
</ItemGroup>
36-
35+
3736
</Project>

src/BookWorm.AppHost/Extension.cs

+14-7
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@
22

33
internal static class Extension
44
{
5-
public static IDistributedApplicationBuilder AddForwardedHeaders(this IDistributedApplicationBuilder builder)
5+
public static IDistributedApplicationBuilder AddForwardedHeaders(
6+
this IDistributedApplicationBuilder builder
7+
)
68
{
79
builder.Services.TryAddLifecycleHook<AddForwardHeadersHook>();
810
return builder;
911
}
1012

1113
internal sealed class AddForwardHeadersHook : IDistributedApplicationLifecycleHook
1214
{
13-
public Task BeforeStartAsync(DistributedApplicationModel appModel,
14-
CancellationToken cancellationToken = default)
15+
public Task BeforeStartAsync(
16+
DistributedApplicationModel appModel,
17+
CancellationToken cancellationToken = default
18+
)
1519
{
1620
foreach (var p in appModel.GetProjectResources())
1721
{
18-
p.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
19-
{
20-
context.EnvironmentVariables["ASPNETCORE_FORWARDEDHEADERS_ENABLED"] = "true";
21-
}));
22+
p.Annotations.Add(
23+
new EnvironmentCallbackAnnotation(context =>
24+
{
25+
context.EnvironmentVariables["ASPNETCORE_FORWARDEDHEADERS_ENABLED"] =
26+
"true";
27+
})
28+
);
2229
}
2330

2431
return Task.CompletedTask;

src/BookWorm.AppHost/GlobalUsings.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
global using Aspirant.Hosting;
2-
global using Aspire.Hosting.Lifecycle;
1+
global using Aspire.Hosting.Lifecycle;
32
global using BookWorm.AppHost;
43
global using BookWorm.Constants;
54
global using BookWorm.HealthCheck.Hosting;

0 commit comments

Comments
 (0)