Is there a mechanism to compare EntityObject values for equal values in Entity Framework?

entity-framework equality

Question

Is there an easy method to determine if two EntityObjects have identical values? I don't care if the EntityKey is different; I just want to make sure that all of the database variables are the same.

Is this a built-in possibility? Should I create my own way instead?

I assume Equals() doesn't operate here the way I want it to?

1
4
11/23/2009 7:22:56 PM

Accepted Answer

Equals() It wouldn't assist you there because verification of referential equality.

Check out this number: How should two entity framework entities be compared?

ADVANCE 2014:
In keeping with the present state of EF, a more thorough response would be that you could override the Equality operator in a code-first model to give a value-equality check.

3
5/23/2017 12:01:12 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow