Skip to content

The Advantages of Cherry Picking with DataContractAttribute

fonlow edited this page Jun 1, 2017 · 1 revision

Firstly NewtonSoft.Json handles DataContractAttribute and related attributes very well.

It is a good practice to define most if not all data models in an assembly without other behavioral codes. And the assembly depends on only BCL, without depending on Entity Framework, MVC or NewtonSoft.Json.

You could easily support RPC, REST/HATEOAS, and WCF based on the same code base.

Opt-in is good for using the data models for multiple purposes:

  1. Serialization upon different medias.
  2. Entity Framework Code First.
Clone this wiki locally