AspireEFPostgreSqlExtensions.EnrichNpgsqlDbContext<TContext> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Configures retries, health check, logging and telemetry for the DbContext.
public static void EnrichNpgsqlDbContext<TContext> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Action<Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.NpgsqlEntityFrameworkCorePostgreSQLSettings>? configureSettings = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member EnrichNpgsqlDbContext : Microsoft.Extensions.Hosting.IHostApplicationBuilder * Action<Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.NpgsqlEntityFrameworkCorePostgreSQLSettings> -> unit (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Sub EnrichNpgsqlDbContext(Of TContext As DbContext) (builder As IHostApplicationBuilder, Optional configureSettings As Action(Of NpgsqlEntityFrameworkCorePostgreSQLSettings) = Nothing)
Type Parameters
- TContext
Parameters
- builder
- IHostApplicationBuilder
- configureSettings
- Action<NpgsqlEntityFrameworkCorePostgreSQLSettings>
Exceptions
Thrown if mandatory builder
is null.
Thrown when mandatory DbContext is not registered in DI.