This topic has not yet been rated - Rate this topic

EntityKey.Equals Method (Object)

Returns a value that indicates whether this instance is equal to a specified object.

Namespace:  System.Data
Assembly:  System.Data.Entity (in System.Data.Entity.dll)
public override bool Equals(
	Object obj
)

Parameters

obj
Type: System.Object

An Object to compare with this instance.

Return Value

Type: System.Boolean
true if this instance and obj have equal values; otherwise, false.

Temporary keys have different comparison semantics than permanent keys:

  • Temporary keys use reference equality. That is, two references to the exact same temporary EntityKey instance are equal but no other EntityKey instances are equal.

  • Permanent keys determine equality based on the values of the contained key properties and the EntitySet. That is, you can have two separate EntityKey instances that are equal if their EntitySet objects are the same and their key values are equal.

In addition, temporary keys have no EntitySet or key values, but permanent keys do.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.