How to use private setters with NewtonSoftJson
Writing software with OOP language like c# requires good encapsulation in order to have healthy code base and extensible system. To achieve this you have to use the internal
, private
, protected
, public
access modifiers properly. However, when you want to deserialize to an object which has private set
properties using the default NewtonSoft.Json settings you are out of luck. It is pretty easy to achieve this.