This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi I am trying to serialize (using the DataContractSerializer) an Entity that has a collection of child entities and am getting the following exception: 'Mindscape.LightSpeed.EntityCollection`1[[MyType, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is an invalid collection type since it has DataContractAttribute attribute. Can you help? Thanks Patrick |
|
|
Hi Patrick, If you are serializing your entities and include the EntityCollection properties you will need to use a special version of the DataContract formatter known as the NetDataContractFormatter which allows correct serialization of collection types which have been marked with a DataContract attribute. We have included an attribute which you can apply to your service operations to automatically use that serializer called UseNetDataContractSerializerAttribute, alternatively you can manually construct the NetDataContractSerializer which is in the Mindscape.LightSpeed.ServiceModel namespace. We have noted this in the documentation here: http://www.mindscapehq.com/documentation/lightspeed/Building-Distributed-Applications-/Distributed-Entity-Programming#Toc297195068 Jeremy |
|