How to change the serialization mode to unidirecti

2020-04-15 03:43发布

In an article i have read about changing serialization mode to unidirectional in Linq to SQL, I want to change serialization mode to Unidirectional in entity framework in order to use serialized entity framework objects on client side using WCF service. Guide me please.

1条回答
爷的心禁止访问
2楼-- · 2020-04-15 04:34

Entity framework doesn't have such setting. This unidirectional configuration was for Linq-to-sql where it forced code generator to mark each entity with [DataContract(IsReference=true)]. Built-in EF code generator and T4 templates for EntityObjects or STEs do this automatically. If you want to use POCO T4 generator template for class generation you must modify template to mark every entity class with [DataContract(IsReference=true)] and each property with [DataMember].

查看更多
登录 后发表回答