Class ModelRuntimeInitializer
- Namespace
- Microsoft.EntityFrameworkCore.Infrastructure
- Assembly
- Microsoft.EntityFrameworkCore.dll
Initializes a 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 ModelRuntimeInitializer : IModelRuntimeInitializer
- Inheritance
-
ModelRuntimeInitializer
- Implements
- Inherited Members
Remarks
The service lifetime is Singleton. This means a single instance is used by many 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
ModelRuntimeInitializer(ModelRuntimeInitializerDependencies)
Creates a new ModelRuntimeInitializer instance.
public ModelRuntimeInitializer(ModelRuntimeInitializerDependencies dependencies)
Parameters
dependencies
ModelRuntimeInitializerDependenciesThe dependencies to use.
Properties
Dependencies
Dependencies for this service.
protected virtual ModelRuntimeInitializerDependencies Dependencies { get; }
Property Value
Methods
Initialize(IModel, bool, IDiagnosticsLogger<Validation>?)
Validates and initializes the given model with runtime dependencies.
public virtual IModel Initialize(IModel model, bool designTime = true, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>? validationLogger = null)
Parameters
model
IModelThe model to initialize.
designTime
boolWhether the model should contain design-time configuration.
validationLogger
IDiagnosticsLogger<DbLoggerCategory.Model.Validation>The validation logger.
Returns
- IModel
The initialized model.
InitializeModel(IModel, bool, bool)
Initializes the given model with runtime dependencies.
protected virtual void InitializeModel(IModel model, bool designTime, bool prevalidation)