Reputation: 454
I have a workflow and am persisting it into the database. It all worked fine until I tried using entities in the workflow. Because I'm using POCOs the workflow seems to have trouble serializing the object, especially the relationships.
Now the weird thing is, the first time I start the workflow the serialization works and the object is realoaded into the workflow on resuming the bookmark. But this time when persisting the workflow, I get the following exception: "The EntityCollection object could not be serialized. This type of object cannot be serialized when the RelationshipManager belongs to an entity object that does not implement IEntityWithRelationships."
I saw that this might help, but I don't have a service and haven't figured out how to get it working without one. http://msdn.microsoft.com/en-us/library/ee705457.aspx
Does anyone have suggestions? Or do you think switching to use services would solve my problem?
Thanks
Upvotes: 1
Views: 635
Reputation: 3279
Objects stored as variables in Workflow are serialized and deserialized when saved to persistence. There is no opportunity for you to get involved in this serialization process as there is with a WCF service. Your options would be to use types that dont come from your Entity Framework POCO library or move the code to a service that you call from WF.
Upvotes: 1