2012-01-06 87 views
0

我試圖堅持一個EF POCO作爲變量的工作流。當我嘗試堅持(和工作流程試圖序列化對象),我得到一個錯誤:在工作流持久性中序列化POCO EF對象

Type 'System.Collections.Generic.ICollection`1[MyObject]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.

任何想法如何解決這個問題?

回答

0

把它變成一個列表可能是解決這個問題的最簡單方法。問題是,它不知道如何連載您的收藏

+0

你能完成你的評論嗎?這似乎是數據協定序列化程序的工作原理,因爲我可以在工作流之外序列化它。 – user472292 2012-01-06 04:27:35