Share via


AspireEFPostgreSqlExtensions Class

Definition

Provides extension methods for registering a PostgreSQL database context in an Aspire application.

public static class AspireEFPostgreSqlExtensions
type AspireEFPostgreSqlExtensions = class
Public Module AspireEFPostgreSqlExtensions
Inheritance
AspireEFPostgreSqlExtensions

Methods

AddNpgsqlDbContext<TContext>(IHostApplicationBuilder, String, Action<NpgsqlEntityFrameworkCorePostgreSQLSettings>, Action<DbContextOptionsBuilder>)

Registers the given DbContext as a service in the services provided by the builder. Enables db context pooling, retries, corresponding health check, logging and telemetry.

EnrichNpgsqlDbContext<TContext>(IHostApplicationBuilder, Action<NpgsqlEntityFrameworkCorePostgreSQLSettings>)

Configures retries, health check, logging and telemetry for the DbContext.

Applies to