Customise NewtonSoft.Json for Value Object serialisation [duplicate]
问题 This question already has answers here : Json.net how to serialize object as value (6 answers) Closed 2 years ago . Sometimes, perhaps in a DDD situation, you might want to use C# to create Value Objects to represent data, to give more meaning to your domain than using primitive types would, with the added benefit of being immutable. For example: public class PostalCode // Bit like a zipcode { public string Value { get; private set; } public PostalCode(string value) { Value = value; } //