tirsdag 9. desember 2008

Bug in how LINQ2SQL tracks changes?

Just realized (through a reported bug in my code) that you have to be careful with the Attach to DataContext pattern (Note to self. Remember to blog on this).

It seems that even though attaching a newly created POCO to your DataContext will start change tracking, setting properties to the "type default" value doesn't add an entry to the change log for the DataContext.

I will try to verify this partly by taking alook under the hood of LINQ2SQL (thanks Lutz ;)) and partly by working around this in my code. Should this be considered a bug in LINQ2SQL? I for one am open for debate.

Will be back with more on this.

Ingen kommentarer: