IncludeMetadataConvention 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
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() |
已淘汰.
此 DbModelBuilder 慣例會使 DbModelBuilder 在建置模型時包含模型的相關中繼資料。 依慣例建立模型時 DbContext ,會將此慣例新增至 DbModelBuilder 所使用的模型清單。 如果 DbCoNtext 用來建立資料庫,這會導致模型中繼資料寫入資料庫。 然後,這可用來快速檢查模型,以查看模型自上次針對資料庫使用以來是否已變更。 在衍生 DbCoNtext 類別上覆寫 OnModelCreating 方法,即可從 DbModelBuilder 慣例中移除此慣例。 |
方法
| Properties() |
已淘汰.
開始設定適用于模型中所有屬性的輕量型慣例。 (繼承來源 Convention) |
| Properties<T>() |
已淘汰.
開始設定輕量型慣例,此慣例會套用至模型中指定類型的所有基本屬性。 (繼承來源 Convention) |
| Types() |
已淘汰.
開始設定適用于模型中所有對應類型的輕量型慣例。 (繼承來源 Convention) |
| Types<T>() |
已淘汰.
開始設定輕量型慣例,此慣例會套用至衍生自或實作指定型別之模型中的所有對應型別。 (繼承來源 Convention) |