EntityKey 类

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

表示实体的标识符。

继承层次结构

System.Object
  System.Data.Entity.Core.EntityKey

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

语法

声明
<SerializableAttribute> _
<DataContractAttribute(IsReference := True)> _
<DebuggerDisplayAttribute("{ConcatKeyValue()}")> _
Public NotInheritable Class EntityKey _
    Implements IEquatable(Of EntityKey)
用法
Dim instance As EntityKey
[SerializableAttribute]
[DataContractAttribute(IsReference = true)]
[DebuggerDisplayAttribute("{ConcatKeyValue()}")]
public sealed class EntityKey : IEquatable<EntityKey>
[SerializableAttribute]
[DataContractAttribute(IsReference = true)]
[DebuggerDisplayAttribute(L"{ConcatKeyValue()}")]
public ref class EntityKey sealed : IEquatable<EntityKey^>
[<SealedAttribute>]
[<SerializableAttribute>]
[<DataContractAttribute(IsReference = true)>]
[<DebuggerDisplayAttribute("{ConcatKeyValue()}")>]
type EntityKey =  
    class 
        interface IEquatable<EntityKey>
    end
public final class EntityKey implements IEquatable<EntityKey>

EntityKey 类型公开以下成员。

构造函数

  名称 描述
公共方法 EntityKey() 初始化 EntityKey 类的新实例。
公共方法 EntityKey(String, IEnumerable<KeyValuePair<String, Object>>) 使用给定的键值初始化 EntityKey 类的新实例。
公共方法 EntityKey(String, IEnumerable<EntityKeyMember>) 使用给定的键值初始化 EntityKey 类的新实例。
公共方法 EntityKey(String, String, Object) 使用给定单个键名称和值初始化 EntityKey 类的新实例。

顶部

属性

  名称 描述
公共属性 EntityContainerName 获取或设置 EntityContainer 名称,该名称标识包含实体的实体容器。
公共属性 EntityKeyValues 获取或设置标识实体的键值。
公共属性静态成员 EntityNotValidKey 获取单一 EntityKey,其标识因失败的 TREAT 操作产生的实体。
公共属性 EntitySetName 获取或设置 EntitySet 名称,该名称标识包含实体的实体集。
公共属性 IsTemporary 获取一个值,该值指示此键是否为临时键。
公共属性静态成员 NoEntitySetKey 获取用来标识只读实体的单一 EntityKey。

顶部

方法

  名称 描述
公共方法 Equals(Object) 指示此实例是否与给定的键相等的值。 (重写 Object.Equals(Object)。)
公共方法 Equals(EntityKey) 指示此实例是否与给定的键相等的值。
公共方法 GetEntitySet 从给定的元数据工作区按实体容器名称和实体集名称获取此实体键的实体集。
公共方法 GetHashCode 返回基于值的哈希代码,以便允许在哈希表中使用 EntityKey。 (重写 Object.GetHashCode()。)
公共方法 GetType (继承自 Object。)
公共方法 OnDeserialized 在反序列化此 EntityKey 后调用。
公共方法 OnDeserializing 在反序列化此 EntityKey 后调用。
公共方法 ToString (继承自 Object。)

顶部

运算符

  名称 描述
公共运算符静态成员 Equality 指示两个键是否相等的值。
公共运算符静态成员 Inequality 指示两个键是否不相等的值。

顶部

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

System.Data.Entity.Core 命名空间