ObjectStateManager.TryGetObjectStateEntry 方法 (EntityKey, ObjectStateEntry%)

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

尝试检索具有指定 EntityKey 的对象或关系的对应 ObjectStateEntry

命名空间:  System.Data.Entity.Core.Objects
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
Public Overridable Function TryGetObjectStateEntry ( _
    key As EntityKey, _
    <OutAttribute> ByRef entry As ObjectStateEntry _
) As Boolean
用法
Dim instance As ObjectStateManager 
Dim key As EntityKey 
Dim entry As ObjectStateEntry 
Dim returnValue As Boolean 

returnValue = instance.TryGetObjectStateEntry(key, _
    entry)
public virtual bool TryGetObjectStateEntry(
    EntityKey key,
    out ObjectStateEntry entry
)
public:
virtual bool TryGetObjectStateEntry(
    EntityKey^ key, 
    [OutAttribute] ObjectStateEntry^% entry
)
abstract TryGetObjectStateEntry : 
        key:EntityKey * 
        entry:ObjectStateEntry byref -> bool  
override TryGetObjectStateEntry : 
        key:EntityKey * 
        entry:ObjectStateEntry byref -> bool
public function TryGetObjectStateEntry(
    key : EntityKey, 
    entry : ObjectStateEntry
) : boolean

参数

返回值

类型:System.Boolean
一个布尔值,如果给定的 EntityKey 有对应的 ObjectStateEntry,则为 true;否则为 false。

异常

例外 条件
ArgumentNullException

为 key 提供了一个 null(在 Visual Basic 中为 Nothing)值。

请参阅

参考

ObjectStateManager 类

TryGetObjectStateEntry 重载

System.Data.Entity.Core.Objects 命名空间