Hello,
you must mark entity class with DataContract(IsReference = true) attribute and each member you want to expose with DataMember. In some cases it is also possible to mark only members you don't want to expose with IgnoreDataMember attribute but the first solution
is better because it will avoid exceptions with circular references in case of serializing object graph with backward references.
The first solution is automatically used by default entity framework generator and EntityObject Generator T4 template but it mark as DataMember every property. If you want to use T4 template and still selectively describe which property should be or should
not be serialized you must modify T4 template to do it for you (in the most complex case you can end in modifying EDMX manually as well to use some
structural annotations as an additional information for T4 template).
Best regards,
Ladislav