-
Notifications
You must be signed in to change notification settings - Fork 514
Implement .NET Aspire orchestration in Chapter 4 #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3371560
Initial plan
Copilot 4775920
Add .NET Aspire orchestration to Chapter 4
Copilot 98b3cde
Remove Directory props files and add versions to AppHost.csproj
Copilot 684d229
Remove trailing newlines from AppHost files
Copilot 3cb0fc7
Merge branch 'main' into copilot/update-chapter-4-aspire
kamilbaczek 6ad0888
Fix null reference dereference in EventBusModule
Copilot 3863ac9
Use central package management and fix formatting
Copilot d08e267
Fix IDE0055 formatting - remove blank line before ConfigureEndpoints
Copilot 02795b6
Remove properties from root Directory.Build.props
Copilot ba7e3f3
Fix IDE0055 formatting - remove blank line after if statement
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Chapter-4-applying-tactical-domain-driven-design/Directory.Build.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Project> | ||
|
|
||
| </Project> |
10 changes: 10 additions & 0 deletions
10
Chapter-4-applying-tactical-domain-driven-design/Directory.Packages.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
| </PropertyGroup> | ||
| <ItemGroup Label="Production"> | ||
| <PackageVersion Include="Aspire.Hosting.AppHost" Version="13.0.0" /> | ||
| <PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.0.0" /> | ||
| <PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="13.0.0" /> | ||
| </ItemGroup> | ||
| </Project> |
19 changes: 19 additions & 0 deletions
19
Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Fitnet.AppHost.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <IsAspireHost>true</IsAspireHost> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Aspire.Hosting.AppHost" /> | ||
| <PackageReference Include="Aspire.Hosting.PostgreSQL" /> | ||
| <PackageReference Include="Aspire.Hosting.RabbitMQ" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Fitnet.Contracts\Src\Fitnet.Contracts\Fitnet.Contracts.csproj" /> | ||
| <ProjectReference Include="..\Fitnet\Src\Fitnet\Fitnet.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
28 changes: 28 additions & 0 deletions
28
Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| 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>("fitnet-modular-monolith") | ||
| .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development") | ||
| .WithReference(fitnetDatabase, "Database__ConnectionString") | ||
| .WithReference(rabbitmq, "EventBus__ConnectionString") | ||
| .WaitFor(postgres) | ||
| .WaitFor(rabbitmq); | ||
|
|
||
| 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(); |
9 changes: 9 additions & 0 deletions
9
Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/appsettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot fix Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3863ac9. Removed extra blank line to comply with IDE0055 formatting rules.