0

I guess when I generate the entities, they don't have [DataContract] attribute, so I cannot pass the object to client.

2 Answers 2

1

You should use a WCF Data Service, OData, or RIA services, depending upon what you're doing. As you haven't mentioned that, this is all the help I can give.

Sign up to request clarification or add additional context in comments.

1 Comment

I will search them. Thank you.
0

DataContract attribute is not needed since .NET 3.5. When you do not mark classes with DataContract, Serializable, etc. default serialization will be used. It means all public properties with getter and setter will be serialized. But in case of EF it should generatee classes with DataContract and DataMember attributes. In this case it is needed because EF generates object graph with circulate references so EF classes have to be marked with [DataContract(IsReference=true)].

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.