Open skironDotNet opened 10 years ago
P.S. Would be nice to go over all object and create constructors with default instances, if of course there is no reason not to do so :)
One reason to not do this is, if you convert the object back to json this will result into a empty array instead of null value (resulting in leaving the property out in the result json).
so you talking optimization of the resulting JSON string, usually the focus is on optimization of hours spent on development and decreasing bug possibility, anyhow, I don't care, I wish to be removed from this topic
Scenario: I create CampaignSegmentOptions
CampaignSegmentOptions x = new CampaignSegmentOptions(); x.Conditions.Add(some obj); //here I get null object error because Conditions is null
Here is the solution: a public constructor (I will add to my fork)