Linq To Sql or Entity Framework?
The whole story around Linq To Sql (L2S) and the Entity Framework (EF) is rather disturbing. On a personal level, lots of people have asked me why I did not use the EF in my Northwind factory. So, here are my five cents on the subject.It seems Microsoft had the intention to ship the EF with VS2008 but a lack of time forced them to drop it and it’s now planned for SP1. Still even at this SP1-beta stage it’s somehow unacceptable that the multi-tiered solution, which should be there out of the box, is not present. Neither in L2S nor in the EF. It’s unacceptable for me in the sense that the whole world is now gravitating around multi-layered [...]
Linq to SQL and Workflows
Linq to Sql doesn’t play nicely with disconnected layers and you can read about it all over the place. In addition to this you might also encounter the infamousObject reference not set to an instance of an objectwhen trying to use the InsertOnSubmit method of the data context inside a workflow. While this same method works perfectly outside WF it seems you need to have the[DataContract()]attribute on your entities in order to convince Linq2Sql to insert the entity. In the designer this amounts to set the serialization mode to Unidirectional (what’s in a name…). All this comes as a surprise to me since I was looking at data contracts as part of the WCF world.Finally, there is also the minor [...]