語言

IncludeMetadataConvention 類別

定義

警告

The IncludeMetadataConvention is no longer used. EdmMetadata is not included in the model. <see cref="EdmModelDiffer" /> is now used to detect changes in the model.

此 DbModelBuilder 慣例使 DbModelBuilder 在建置模型時包含關於模型的元資料。 當 DbContext 依慣例建立模型時,會將此慣例加入 DbModelBuilder 使用的慣例清單中。 若使用 DbContext 建立資料庫,模型中繼資料就會寫入資料庫。 這可作為快速檢查,看看模型自上次使用以來是否改變。 此慣例可透過覆寫衍生 DbContext 類別上的 OnModelCreating 方法來移除 DbModelBuilder 。

[System.Obsolete("The IncludeMetadataConvention is no longer used. EdmMetadata is not included in the model. <see cref="EdmModelDiffer" /> is now used to detect changes in the model.")]
public class IncludeMetadataConvention : System.Data.Entity.ModelConfiguration.Conventions.Convention
type IncludeMetadataConvention = class
    inherit Convention
Public Class IncludeMetadataConvention
Inherits Convention
繼承
IncludeMetadataConvention
繼承
IncludeMetadataConvention
屬性

建構函式

名稱 Description
IncludeMetadataConvention()
已淘汰.

此 DbModelBuilder 慣例使 DbModelBuilder 在建置模型時包含關於模型的元資料。 當 DbContext 依慣例建立模型時,會將此慣例加入 DbModelBuilder 使用的慣例清單中。 若使用 DbContext 建立資料庫,模型中繼資料就會寫入資料庫。 這可作為快速檢查,看看模型自上次使用以來是否改變。 此慣例可透過覆寫衍生 DbContext 類別上的 OnModelCreating 方法來移除 DbModelBuilder 。

方法

名稱 Description
Properties()
已淘汰.

開始配置適用於模型中所有屬性的輕量級慣例。

(繼承來源 Convention)
Properties<T>()
已淘汰.

開始配置一套輕量級慣例,適用於模型中指定類型的所有原始屬性。

(繼承來源 Convention)
Types()
已淘汰.

開始配置一套適用於模型中所有映射型態的輕量級慣例。

(繼承來源 Convention)
Types<T>()
已淘汰.

開始配置一套輕量級慣例,適用於模型中所有源自或實作指定型別的映射型別。

(繼承來源 Convention)

適用於