共用方式為


DbPropertyValues.GetValue<TValue> 方法

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

取得屬性的值,就像使用具索引的屬性 getter 一樣,但是具有泛型參數的類型。 這對於巢狀字典特別實用,可避免撰寫具有許多轉換的運算式。

命名空間:  System.Data.Entity.Infrastructure
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
Public Function GetValue(Of TValue) ( _
    propertyName As String _
) As TValue
'用途
Dim instance As DbPropertyValues 
Dim propertyName As String 
Dim returnValue As TValue

returnValue = instance.GetValue(propertyName)
public TValue GetValue<TValue>(
    string propertyName
)
public:
generic<typename TValue>
TValue GetValue(
    String^ propertyName
)
member GetValue : 
        propertyName:string -> 'TValue 
JScript does not support generic types and methods.

類型參數

  • TValue
    此屬性的類型。

參數

傳回值

類型:TValue
屬性的值。

請參閱

參考

DbPropertyValues 類別

System.Data.Entity.Infrastructure 命名空間