Table of Contents

Class RelationalModelRuntimeInitializer

Namespace
Microsoft.EntityFrameworkCore.Infrastructure
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Initializes a Microsoft.EntityFrameworkCore.Metadata.IModel with the runtime dependencies.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public class RelationalModelRuntimeInitializer : ModelRuntimeInitializer
Inheritance
RelationalModelRuntimeInitializer

Remarks

The service lifetime is Singleton. This means a single instance is used by many Microsoft.EntityFrameworkCore.DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See Implementation of database providers and extensions for more information and examples.

Constructors

RelationalModelRuntimeInitializer(ModelRuntimeInitializerDependencies, RelationalModelRuntimeInitializerDependencies)

Creates a new Microsoft.EntityFrameworkCore.Infrastructure.ModelRuntimeInitializer instance.

public RelationalModelRuntimeInitializer(ModelRuntimeInitializerDependencies dependencies, RelationalModelRuntimeInitializerDependencies relationalDependencies)

Parameters

dependencies ModelRuntimeInitializerDependencies

The dependencies to use.

relationalDependencies RelationalModelRuntimeInitializerDependencies

The relational dependencies to use.

Properties

RelationalDependencies

Relational provider-specific dependencies for this service.

protected virtual RelationalModelRuntimeInitializerDependencies RelationalDependencies { get; }

Property Value

RelationalModelRuntimeInitializerDependencies

Methods

InitializeModel(IModel, bool, bool)

Initializes the given model with runtime dependencies.

protected override void InitializeModel(IModel model, bool designTime, bool prevalidation)

Parameters

model IModel

The model to initialize.

designTime bool

Whether the model should contain design-time configuration.

prevalidation bool

true indicates that only pre-validation initialization should be performed; false indicates that only post-validation initialization should be performed.