Skip to content

Commit 09299f8

Browse files
Copilotkamilbaczek
andcommitted
Separate AppHost projects: move to respective solution directories
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
1 parent 09d5e99 commit 09299f8

File tree

12 files changed

+50
-28
lines changed

12 files changed

+50
-28
lines changed

Chapter-3-microservice-extraction/Directory.Build.props

Lines changed: 0 additions & 9 deletions
This file was deleted.

Chapter-3-microservice-extraction/Directory.Packages.props

Lines changed: 0 additions & 10 deletions
This file was deleted.

Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Directory.Packages.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup Label="Production">
6+
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.0.0" />
7+
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.0.0" />
8+
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="13.0.0" />
69
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Api" Version="3.2.5" />
710
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="3.2.5" />
811
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Infrastructure" Version="3.2.5" />

Chapter-3-microservice-extraction/Fitnet.AppHost/Fitnet.AppHost.csproj renamed to Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Fitnet.Contracts.AppHost.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<ProjectReference Include="..\Fitnet.Contracts\Src\Fitnet.Contracts\Fitnet.Contracts.csproj" />
16-
<ProjectReference Include="..\Fitnet\Src\Fitnet\Fitnet.csproj" />
15+
<ProjectReference Include="..\Fitnet.Contracts\Fitnet.Contracts.csproj" />
1716
</ItemGroup>
1817

1918
</Project>

Chapter-3-microservice-extraction/Fitnet.AppHost/Program.cs renamed to Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
var rabbitmq = builder.AddRabbitMQ("rabbitmq")
1212
.WithManagementPlugin();
1313

14-
builder.AddProject<Fitnet>("fitnet-modular-monolith")
15-
.WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
16-
.WithReference(fitnetDatabase, "Database__ConnectionString")
17-
.WithReference(rabbitmq, "EventBus__ConnectionString")
18-
.WaitFor(postgres)
19-
.WaitFor(rabbitmq);
20-
2114
builder.AddProject<Fitnet_Contracts>("fitnet-contracts-microservice")
2215
.WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
2316
.WithReference(fitnetDatabase, "Database__ConnectionString")

Chapter-3-microservice-extraction/Fitnet.AppHost/appsettings.json renamed to Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/appsettings.json

File renamed without changes.

Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<Project Path="Fitnet.Contracts.Infrastructure\Fitnet.Contracts.Infrastructure.csproj" Type="Classic C#" />
1111
<Project Path="Fitnet.Contracts.IntegrationEvents\Fitnet.Contracts.IntegrationEvents.csproj" Type="Classic C#" />
1212
<Project Path="Fitnet.Contracts\Fitnet.Contracts.csproj" Type="Classic C#" />
13+
<Project Path="Fitnet.Contracts.AppHost\Fitnet.Contracts.AppHost.csproj" Type="Classic C#" />
1314
</Solution>

Chapter-3-microservice-extraction/Fitnet/Src/Directory.Packages.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup Label="Production">
6+
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.0.0" />
7+
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.0.0" />
68
<PackageVersion Include="Dapper" Version="2.1.66" />
79
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Api" Version="3.2.5" />
810
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="3.2.5" />
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<IsAspireHost>true</IsAspireHost>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Aspire.Hosting.AppHost" />
10+
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\Fitnet\Fitnet.csproj" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Projects;
2+
3+
var builder = DistributedApplication.CreateBuilder(args);
4+
5+
var postgres = builder.AddPostgres("postgres")
6+
.WithImage("postgres", "14.3")
7+
.WithPgAdmin();
8+
9+
var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet");
10+
11+
builder.AddProject<Fitnet>("fitnet-modular-monolith")
12+
.WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
13+
.WithReference(fitnetDatabase, "Database__ConnectionString")
14+
.WaitFor(postgres);
15+
16+
await builder.Build().RunAsync();

0 commit comments

Comments
 (0)