added two samples

This commit is contained in:
2026-02-03 08:31:53 -05:00
parent 97e0ce1733
commit 51f577d218
1120 changed files with 45859 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
var builder = DistributedApplication.CreateBuilder(args);
var natsTransport = builder.AddNats("nats")
.WithJetStream()
.WithLifetime(ContainerLifetime.Persistent);
var pg = builder.AddPostgres("pg")
.WithLifetime(ContainerLifetime.Persistent);
var dbOne = pg.AddDatabase("db-one");
var dbTwo = pg.AddDatabase("db-two");
var apiOne = builder.AddProject<Projects.ApiOne>("one")
.WithReference(dbOne)
.WithReference(natsTransport)
.WaitFor(natsTransport)
.WaitFor(dbOne);
builder.AddProject<Projects.ApiTwo>("two")
.WithReference(dbTwo)
.WithReference(natsTransport)
.WaitFor(natsTransport)
.WaitFor(apiOne) // apiOne creates the "PEOPLE" stream
.WaitFor(dbTwo);
builder.AddProject<Projects.PlainListener>("listener")
.WithReplicas(2)
.WithReference(natsTransport)
.WaitFor(natsTransport)
.WaitFor(apiOne); // apiOne creates the "PEOPLE" stream
builder.AddProject<Projects.LateComer>("late-comer")
.WithExplicitStart()
.WithReference(natsTransport)
.WaitFor(natsTransport)
.WaitFor(apiOne); // apiOne creates the "PEOPLE" stream
builder.Build().Run();

View File

@@ -0,0 +1,23 @@
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>3fd9a60b-40a2-4d52-bdae-fcb13dceb6d3</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.Nats" Version="13.1.0" />
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="13.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ApiOne\ApiOne.csproj" />
<ProjectReference Include="..\ApiTwo\ApiTwo.csproj" />
<ProjectReference Include="..\LateComer\LateComer.csproj" />
<ProjectReference Include="..\PlainListener\PlainListener.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21090",
"ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23000",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22128"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
{
"runtimeOptions": {
"tfm": "net10.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "10.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "10.0.0"
}
],
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Some files were not shown because too many files have changed in this diff Show More