File tree Expand file tree Collapse file tree 14 files changed +172
-49
lines changed
Expand file tree Collapse file tree 14 files changed +172
-49
lines changed Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+ <Sdk Name =" Aspire.AppHost.Sdk" Version =" 13.0.0" />
3+
4+ <PropertyGroup >
5+ <OutputType >Exe</OutputType >
6+ </PropertyGroup >
7+
8+ <ItemGroup >
9+ <PackageReference Include =" Aspire.Hosting.AppHost" />
10+ <PackageReference Include =" Aspire.Hosting.PostgreSQL" />
11+ <PackageReference Include =" Aspire.Hosting.RabbitMQ" />
12+ </ItemGroup >
13+
14+ <ItemGroup >
15+ <ProjectReference Include =" ..\Fitnet.Contracts\Fitnet.Contracts.csproj" />
16+ </ItemGroup >
17+
18+ </Project >
Original file line number Diff line number Diff line change 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+ var rabbitmq = builder . AddRabbitMQ ( "rabbitmq" )
12+ . WithManagementPlugin ( ) ;
13+
14+ builder . AddProject < Fitnet_Contracts > ( "fitnet-contracts-microservice" )
15+ . WithEnvironment ( "ASPNETCORE_ENVIRONMENT" , "Development" )
16+ . WithReference ( fitnetDatabase , "Database__ConnectionString" )
17+ . WithReference ( rabbitmq , "EventBus__ConnectionString" )
18+ . WaitFor ( postgres )
19+ . WaitFor ( rabbitmq ) ;
20+
21+ await builder . Build ( ) . RunAsync ( ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "Logging" : {
3+ "LogLevel" : {
4+ "Default" : " Information" ,
5+ "Microsoft.AspNetCore" : " Warning" ,
6+ "Aspire.Hosting.DistributedApplication" : " Information"
7+ }
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -24,6 +24,25 @@ internal static IServiceCollection AddEventBus(this IServiceCollection services,
2424 return ;
2525 }
2626
27+ var uri = options . Value ! . Uri ;
28+ var username = options . Value ! . Username ;
29+ var password = options . Value ! . Password ;
30+
31+ if ( ! string . IsNullOrEmpty ( uri ) )
32+ {
33+ factoryConfigurator . Host ( uri , h =>
34+ {
35+ if ( ! string . IsNullOrEmpty ( username ) )
36+ {
37+ h . Username ( username ) ;
38+ }
39+ if ( ! string . IsNullOrEmpty ( password ) )
40+ {
41+ h . Password ( password ) ;
42+ }
43+ } ) ;
44+ }
45+
2746 factoryConfigurator . ConfigureEndpoints ( context ) ;
2847 } ) ;
2948 } ) ;
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+ <Sdk Name =" Aspire.AppHost.Sdk" Version =" 13.0.0" />
3+
4+ <PropertyGroup >
5+ <OutputType >Exe</OutputType >
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 >
Original file line number Diff line number Diff line change 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 ( ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "Logging" : {
3+ "LogLevel" : {
4+ "Default" : " Information" ,
5+ "Microsoft.AspNetCore" : " Warning" ,
6+ "Aspire.Hosting.DistributedApplication" : " Information"
7+ }
8+ }
9+ }
You can’t perform that action at this time.
0 commit comments