語言

IModelSource 介面

定義

IModel根據內容產生 。 這通常是由資料庫提供者實作,以確保使用其資料庫專屬的任何慣例和驗證。

資料庫提供者通常會使用這個介面, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

public interface IModelSource
type IModelSource = interface
Public Interface IModelSource
衍生

備註

服務存留期為 Singleton 。 這表示許多 DbContext 實例都會使用單一實例。 實作必須是安全線程。 此服務不能相依于註冊為 Scoped 的服務。

如需詳細資訊和範例,請參閱 資料庫提供者和延伸模組的實作 。

方法

名稱 Description
GetModel(DbContext, IConventionSetBuilder, IModelValidator)

取得要使用的模型。

GetModel(DbContext, IConventionSetBuilder, IModelValidator)

取得要使用的模型。

GetModel(DbContext, IConventionSetBuilder, ModelDependencies)
已淘汰.

取得要使用的模型。

GetModel(DbContext, IConventionSetBuilder)
已淘汰.
已淘汰.

取得要使用的模型。

GetModel(DbContext, ModelCreationDependencies, Boolean)

取得要使用的模型。

適用於