EntityKey.Equals Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value that indicates whether this instance is equal to a specified object.
Overloads
Equals(Object) |
Returns a value that indicates whether this instance is equal to a specified object. |
Equals(EntityKey) |
Returns a value that indicates whether this instance is equal to a specified EntityKey. |
Equals(Object)
Returns a value that indicates whether this instance is equal to a specified object.
public:
override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean
Parameters
Returns
true
if this instance and obj
have equal values; otherwise, false
.
Remarks
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.
Applies to
Equals(EntityKey)
Returns a value that indicates whether this instance is equal to a specified EntityKey.
public:
virtual bool Equals(System::Data::EntityKey ^ other);
public bool Equals (System.Data.EntityKey other);
override this.Equals : System.Data.EntityKey -> bool
Public Function Equals (other As EntityKey) As Boolean
Parameters
Returns
true
if this instance and other
have equal values; otherwise, false
.
Implements
Remarks
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 entity sets are the same and their key values are equal.
In addition, temporary keys have no EntitySet or key values, but permanent keys do.