語言

PropertyValues.TryGetValue<TValue>(String, TValue) 方法

定義

試著像用索引屬性 getter 一樣取得該屬性的值,但類型是通用參數的類型。 如果有屬性,則會將值回傳到輸出參數,否則則是 TValue 的預設值

public virtual bool TryGetValue<TValue>(string propertyName, out TValue value);
abstract member TryGetValue : string * 'Value -> bool
override this.TryGetValue : string * 'Value -> bool
Public Overridable Function TryGetValue(Of TValue) (propertyName As String, ByRef value As TValue) As Boolean

類型參數

TValue

屬性的類型。

參數

propertyName
String

屬性名稱。

value
TValue

如果有的話,房產價值。

傳回

true 若性質存在,則 false。

備註

更多資訊與範例請參閱 EF Core 中的「存取追蹤實體 」。

適用於