I have been writing a lot of code lately which involves serialization using Json.NET and due to the nature of the data that I serialize, sometimes not all of their properties need to be serialized so, I do as follows...
public int Foo { get; set; }
public bool ShouldSerializeFoo() => Foo > -1;
This's good and works but involves a lot of work if you have many properties (in my case I have over 100).
So, I wanted to know if there's an alternative to writing those methods.