I'm copying an entity with EntityGraph().Copy() in Silverlight 4 client. It's working fine already on entities without complex types. But as soon a complex type is used in the entity I get following errors:
- When the complex type is not included in the EntityGraph through Edge I get this error: "ComplexObject instances cannot be shared." That's probably normal as these instances belong to their related entities and cannot be re-used on
- When the complex type is included in the EntityGraph I get this this error: "Unable to cast object of type 'MyComplexType' to type 'System.ServiceModel.DomainServices.Client.Entity'." Also normal imo.
I need these complex types on the client, so I can't exclude them with the Exclude attribute in the metadata class. I also went through the documentation and did some hours of searches on the internet but to no avail.
Has anyone an idea how I could get around these errors? If no solution I'll have to drop the complex types on the entities and refactor a lot of code which is already working with the complex types...
Thx in advance!