語言

DbPropertyValues.GetValue<TValue>(String) 方法

定義

取得屬性的值,就像使用索引屬性 getter 一樣,但型別是通用參數的類型。 這對於巢狀字典特別有用,可以避免寫出帶有大量 cast 的表達式。

public TValue GetValue<TValue>(string propertyName);
member this.GetValue : string -> 'Value
Public Function GetValue(Of TValue) (propertyName As String) As TValue

類型參數

TValue

屬性的類型。

參數

propertyName
String

屬性的名稱。

傳回

TValue

屬性的值。

適用於