ObjectContext.TryGetObjectByKey(EntityKey, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個具有指定實體鍵的物件。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")]
public virtual bool TryGetObjectByKey(System.Data.Entity.Core.EntityKey key, out object value);
abstract member TryGetObjectByKey : System.Data.Entity.Core.EntityKey * -> bool
override this.TryGetObjectByKey : System.Data.Entity.Core.EntityKey * -> bool
Public Overridable Function TryGetObjectByKey (key As EntityKey, ByRef value As Object) As Boolean
參數
- key
- EntityKey
要找到的物品鑰匙。
- value
- Object
當此方法回傳時,包含物件。
傳回
若物件成功取回,則為真。 若鍵為臨時、連線為空,或值為空,則為假。
- 屬性
例外狀況
鍵 的元資料不相容。