How to change the serialization mode to unidirectional in Entity Framework?

前端 未结 1 1754
眼角桃花
眼角桃花 2021-01-21 19:38

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

相关标签:
1条回答
  • 2021-01-21 20:26

    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].

    0 讨论(0)
提交回复
热议问题