語言

PropertyExtensions 類別

定義

警告

Use IReadOnlyProperty

的 IReadOnlyProperty擴展方法 。

public static class PropertyExtensions
[System.Obsolete("Use IReadOnlyProperty")]
public static class PropertyExtensions
type PropertyExtensions = class
[<System.Obsolete("Use IReadOnlyProperty")>]
type PropertyExtensions = class
Public Module PropertyExtensions
繼承
PropertyExtensions
屬性

方法

名稱 Description
CreateKeyEqualityComparer<TProperty>(IProperty)
已淘汰.

建立 IEqualityComparer<T> 給定屬性類型的 for 值。

FindContainingPrimaryKey(IProperty)
已淘汰.

取得使用該屬性的主鍵(包括包含該屬性的複合主鍵)。

FindFirstPrincipal(IProperty)
已淘汰.

若該屬性是外鍵的一部分,則找到該屬性所受約束的第一個主要性質。

FindMapping(IProperty)
已淘汰.

回傳給定屬性的 。CoreTypeMapping

FindPrincipals(IProperty)
已淘汰.

尋找包含該屬性的清單,若該屬性屬於外鍵,則該屬性受限制。

FindTypeMapping(IProperty)
已淘汰.

回傳給定屬性的 。CoreTypeMapping

Format(IEnumerable<IPropertyBase>, Boolean)
已淘汰.

建立格式化的字串表示,例如在拋出使用該屬性的鍵、索引等例外時非常有用。

GetAfterSaveBehavior(IProperty)
已淘汰.

會取得一個值,表示該屬性在實體儲存到資料庫後是否能被修改。

若 Throw,則在該實體存在於資料庫後,若該屬性被賦予新值,則會拋出例外。

若 Ignore,則資料庫中已存在的實體屬性值任何修改將被忽略。

GetBeforeSaveBehavior(IProperty)
已淘汰.

會取得一個值,指示該屬性是否能在實體儲存到資料庫前被修改。

若 Throw,則當該屬性在狀態中 Added 被賦值時,將拋出異常。

若 Ignore,則任何值集合在狀態 Added 下都會被忽略。

GetContainingForeignKeys(IProperty)
已淘汰.

取得所有使用此屬性的外鍵(包括包含此屬性的複合外鍵)。

GetContainingIndexes(IProperty)
已淘汰.

取得所有使用此屬性的索引(包括包含此屬性的複合索引)。

GetContainingKeys(IProperty)
已淘汰.

取得所有使用此屬性的主鍵或備用鍵(包括包含此屬性的複合鍵)。

GetContainingPrimaryKey(IProperty)
已淘汰.

取得使用該屬性的主鍵(包括包含該屬性的複合主鍵)。

GetKeyValueComparer(IProperty)
已淘汰.

用鍵值來 ValueComparer 使用這個屬性,或者 null 如果沒有設定任何鍵。

GetMaxLength(IProperty)
已淘汰.

取得此屬性允許的最大資料長度。 例如,若性質為 a String ,則這是最大字元數。

GetPrecision(IProperty)
已淘汰.

取得此性質允許的資料精確度。 例如,若性質為 a Decimal ,則為最大數字數。

GetProviderClrType(IProperty)
已淘汰.

取得屬性值在送給資料庫提供者前會轉換成的類型。

GetScale(IProperty)
已淘汰.

取得此屬性允許的資料規模。 例如,若性質為 a Decimal ,則此為最大小數位數。

GetStructuralValueComparer(IProperty)
已淘汰.

獲得 ValueComparer 此屬性的結構複製品,或 null 在未設定時使用。

GetTypeMapping(IProperty)
已淘汰.

從最終模型回傳給定屬性的 。CoreTypeMapping

GetValueComparer(IProperty)
已淘汰.

如果沒有設定,則會得到 。ValueComparernull

GetValueConverter(IProperty)
已淘汰.

取得這個屬性的自訂 ValueConverter 設定。

GetValueGeneratorFactory(IProperty)
已淘汰.

取得已設定為此屬性產生數值的工廠(如果有的話)。

IsForeignKey(IProperty)
已淘汰.

會獲得一個值,表示該屬性是否被用作外鍵(或複合外鍵的一部分)。

IsIndex(IProperty)
已淘汰.

會得到一個值,表示該屬性是否被用作指數(或是綜合指數的一部分)。

IsKey(IProperty)
已淘汰.

會獲得一個值,表示該屬性是否被用作主鍵或備用鍵(或是複合主鍵或備用鍵的一部分)。

IsPrimaryKey(IProperty)
已淘汰.

會獲得一個值,表示此屬性是否被用作主鍵(或複合主鍵的一部分)。

IsUnicode(IProperty)
已淘汰.

會取得一個值,表示該屬性是否能持久化 Unicode 字元。

IsUniqueIndex(IProperty)
已淘汰.

會獲得一個值,表示此屬性是否被用作唯一指數(或是唯一綜合指數的一部分)。

ToDebugString(IProperty, MetadataDebugStringOptions, Int32)
已淘汰.

建立給定元資料的可讀表示法。

警告:請勿依賴回傳字串的格式。 它僅設計用於除錯,且可能在不同版本間任意變動。

適用於