Newtonsoft's alternative to using JsonConstructorAttribute

I am serializing a json object using newtonsoft json serializer.

Now I want to deserialize it, my object is immutable, it contains two constructors, both with parameters. I have to decorate the second using the JsonConstructorAttribute attribute.

It works great.

But!

I don't like the idea of โ€‹โ€‹decorating my constructor with an attribute, is there any other way to specify it?

+4
source share

Source: https://habr.com/ru/post/1491339/


All Articles