title: How to make Json.Net skip serialization of empty collections
body: <p>I have an object that contains several properties that are a List of strings <code>List&lt;String&gt;</code> or a dictionary of strings <code>Dictionary&lt;string,string&gt;</code>.   I want to serialize the object to json using Json.net and I want to have the least amount of text generated.</p>
  
  <p>I am using the DefaultValueHandling and NullValueHandling to set default values to strings and integers.  But how can I define the DefaultValueHandling to ignore the property in the serialized output if it is initialized to an empty <code>List&lt;String&gt;</code> or <code>Dictionary&lt;string,string&gt;</code>?</p>
  
  <p>Some sample output is:</p>
  
  <pre><code>{
   "Value1": "my value",
   "Value2": 3,
   "List1": [],
   "List2": []
  }
  </code></pre>
  
  <p>I want to get a result that ignores the two lists in the above example, because they are set to the default value of an empty list.</p>
  
  <p>Any help will be appreciated</p>