PostgreSQL® support for Aspire.
$ dotnet add package Aspire.Hosting.PostgreSQLProvides extension methods and resource definitions for a .NET Aspire AppHost to configure a PostgreSQL resource.
In your AppHost project, install the .NET Aspire PostgreSQL Hosting library with NuGet:
dotnet add package Aspire.Hosting.PostgreSQL
Then, in the AppHost.cs file of AppHost, add a PostgreSQL resource and consume the connection using the following methods:
var db = builder.AddPostgres("pgsql").AddDatabase("mydb");
var myService = builder.AddProject<Projects.MyService>()
.WithReference(db);
https://learn.microsoft.com/dotnet/aspire/database/postgresql-component https://learn.microsoft.com/dotnet/aspire/database/postgresql-entity-framework-component
https://github.com/dotnet/aspire
*Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.