Is there a simple way to compare two EntityObjects for value-equality. I simply want to check if all the d开发者_JS百科atabase-values are the same, so I don't care if the EntityKey is different.
Is this possible built-in? Or should I just write my own method.
I guess Equals() doesn't work as I want it here?
Equals()
checks for referential equality, so it wouldn't help you there.
Take a look at this question: What is the best way to compare two entity framework entities?
UPDATE 2014:
A more complete answer, in line with the current state of EF, would be that you could override the Equality operator in a code-first model to provide a check for value-equality.
精彩评论