2012-01-06 84 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