NullValueHandling not working as expected for arrays

Aug 31, 2012 at 4:16 PM
Edited Aug 31, 2012 at 4:17 PM

I have a POCO with an array member that may or may not be null. I want that array to be ignored when emitting JSON. I've tried using JsonProperty on the property and using JsonSerializerSettings when I call SerializeObject, but I still get something like the following:

{

   "Id":1,
   "Name":"metrics_over_time_for_channel",
   "DisplayName":"Metrics Over Time For Channel",
   "Columns":[

   ],
   "Parameters":[

   ]
}
I'm using JSON.NET 4.5 r8. Am I misunderstanding how NullValueHandling.Ignore is supposed to work?