AspireSqlServerEFCoreSqlClientExtensions.EnrichSqlServerDbContext<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 EnrichSqlServerDbContext<TContext> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Action<Aspire.Microsoft.EntityFrameworkCore.SqlServer.MicrosoftEntityFrameworkCoreSqlServerSettings>? configureSettings = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member EnrichSqlServerDbContext : Microsoft.Extensions.Hosting.IHostApplicationBuilder * Action<Aspire.Microsoft.EntityFrameworkCore.SqlServer.MicrosoftEntityFrameworkCoreSqlServerSettings> -> unit (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Sub EnrichSqlServerDbContext(Of TContext As DbContext) (builder As IHostApplicationBuilder, Optional configureSettings As Action(Of MicrosoftEntityFrameworkCoreSqlServerSettings) = Nothing)
Type Parameters
- TContext
Parameters
- builder
- IHostApplicationBuilder
- configureSettings
- Action<MicrosoftEntityFrameworkCoreSqlServerSettings>
Exceptions
Thrown if mandatory builder
is null.
Thrown when mandatory DbContext is not registered in DI.