共用方式為


ModelRuntimeInitializer.Initialize 方法

定義

使用執行時間相依性驗證和初始化指定的模型。

public virtual Microsoft.EntityFrameworkCore.Metadata.IModel Initialize (Microsoft.EntityFrameworkCore.Metadata.IModel model, bool designTime = true, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation>? validationLogger = default);
abstract member Initialize : Microsoft.EntityFrameworkCore.Metadata.IModel * bool * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation> -> Microsoft.EntityFrameworkCore.Metadata.IModel
override this.Initialize : Microsoft.EntityFrameworkCore.Metadata.IModel * bool * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Model.Validation> -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Overridable Function Initialize (model As IModel, Optional designTime As Boolean = true, Optional validationLogger As IDiagnosticsLogger(Of DbLoggerCategory.Model.Validation) = Nothing) As IModel

參數

model
IModel

要初始化的模型。

designTime
Boolean

模型是否應該包含設計階段組態。

validationLogger
IDiagnosticsLogger<DbLoggerCategory.Model.Validation>

驗證記錄器。

傳回

初始化的模型。

實作

適用於