Interface IModelRuntimeInitializer
- Namespace
- Microsoft.EntityFrameworkCore.Infrastructure
- Assembly
- Microsoft.EntityFrameworkCore.dll
Initializes a IModel with the runtime dependencies. This is typically implemented by database providers to ensure that any runtime dependencies specific to their database are used.
This interface is typically used by database providers (and other extensions). It is generally not used in application code.
public interface IModelRuntimeInitializer
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.
Methods
Initialize(IModel, bool, IDiagnosticsLogger<Validation>?)
Validates and initializes the given model with runtime dependencies.
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. If null is provided validation will not be performed.
Returns
- IModel
The initialized model.