LINQ Serialization Issues

Aug 11, 2008 at 6:38 AM
As per my implementation of LINQ in 3.5, we haven't faced any problem while inserting / updating the objects using LINQ classes. So, we are not using any cloning for that.

But I think the issue is not exactly only this.

I am facing a trouble while fetching data from database using linq classes. the scenario is something like this:
1) i need to fetch object of class A
2) class A has entitySet of class B object that are having EntityRef to class A object in them
3) now, while fetching Class A object i am facing a problem that Wrokflow is not able to fetch that object because EntitySet has been derived from iList and that is not serializable.

and if will not use IList i.e. EntitySet , then the real magic of LINQ vanishes; as i am using cascade update feature of LINQ classes where one has to commit only the base object and all the other objects ttached to it gets submitted to database automatically.

Hope you can understand. please help me out.

Aug 13, 2008 at 10:53 AM


I encountered some incompatibilities when LINQ is used together with WF. If the cloning is removed, WF would throw serialization exceptions. This is because WF would try to persist the updated entity (with new timestamp data) that has an attached data context.

I agree with you that some of LINQ's features will diminish if we use it with WF. I hope they will be able to fix it in future releases or service packs.

Best Regards,