共用方式為


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
屬性

建構函式

IncludeMetadataConvention()
已淘汰.

DbModelBuilder 慣例會使 DbModelBuilder 在建置模型時包含模型的相關中繼資料。 依慣例建立模型時 DbContext ,會將此慣例新增至 DbModelBuilder 所使用的模型清單。 如果 DbCoNtext 用來建立資料庫,這會導致模型中繼資料寫入資料庫。 然後,這可用來快速檢查模型,以查看模型自上次針對資料庫使用以來是否已變更。 在衍生 DbCoNtext 類別上覆寫 OnModelCreating 方法,即可從 DbModelBuilder 慣例中移除此慣例。

方法

Properties()
已淘汰.

開始設定適用于模型中所有屬性的輕量型慣例。

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

開始設定輕量型慣例,此慣例會套用至模型中指定類型的所有基本屬性。

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

開始設定適用于模型中所有對應類型的輕量型慣例。

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

開始設定輕量型慣例,此慣例會套用至衍生自或實作指定型別之模型中的所有對應型別。

(繼承來源 Convention)

適用於