Open awbacker opened 14 years ago
I've come across this myself and fixed it in the templates I use. I'll fix.
It does not only affect GUIDs, it affects all types (i bumped into the bug with a class that had an int key value). I think the problem is the implicit cast that happens when the value is returned as object by the KeyValue() method.
The equals method is broken when the underlying column is a GUID. Because the "==" operator is used, Guids do not compare as equal. The object.Equals() method, and the method in general needs to be re-written to be a bit safer. I'm not claiming this is an ideal implementation though: