KeyFieldIsUniqueInCollectionConstraint fails when loading a new object #88

Closed
hisystems opened this Issue Aug 25, 2013 · 0 comments

Comments

Projects
None yet
1 participant
Owner

hisystems commented Aug 25, 2013

KeyFieldIsUniqueInCollectionConstraint fails for a new object because @@identity returns a DECIMAL and there is an equality test with the value from the database for usually an INT field. Therefore (DECIMAL)1 and INT(1) are not considered equal and the constraint incorrectly fails.

This does not affect situations where the object is reloaded and then saved because the DistinctValue will be of the correct INT type.

hisystems was assigned Aug 25, 2013

hisystems closed this in cc867ae Aug 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment