You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wilsonormapper
I ran into an interesting bug in my code today. An entity was loading
with an ObjectState of Updated, so it was being persisted when I saved
its parent's graph. It took me a long time to discover that it was
loading as Updated, but once I did the reason was fairly easy to track
down. The entity used a lookup mapping on a field that was nullable in
the enity's table. The initial value for the lookup was null but the
default value of the bool property was false so WORM considered it
dirty. I only caught this because a new trigger on the table was
preventing the phantom update.
The moral is to always assign a nullVlaue in a lookup if the lookup
might return null.