title: MVC4 Action returning JsonResult without null
body: <p>I have a action which returns an JsonResult for an object of a particular class. I have decorated the properties of this class with some attrib to avoid null fields. Class definition is:</p>
  
  <pre><code>    private class GanttEvent
      {
          public String name { get; set; }
  
          [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
          public String desc { get; set; }
  
          [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
          public List&lt;GanttValue&gt; values { get; set; }
      }
  </code></pre>
  
  <p>And in my Action i use an object </p>
  
  <pre><code>    var res = new List&lt;GanttEvent&gt;();
  </code></pre>
  
  <p>which I return using:        </p>
  
  <pre><code>    return Json(res, JsonRequestBehavior.AllowGet);
  </code></pre>
  
  <p>Unfortunatelly, I'm still receiving null values at output:</p>
  
  <pre><code>    [{"name":"1.1 PREVIOS AL INICIO ","desc":null,"values":null},{"name":"F04-PGA-S10","desc":"Acta preconstrucción","values":null},{"name":"F37-PGA-S10","desc":"Plan de inversión del anticipo","values":null},{"name":"F09-PGA-S10","desc":"Acta de vecindad","values":null},{"name":"F05-PGA-S10","desc":"Acta de inicio","values":null},{"name":"F01-PGA-S10","desc":"Desembolso de anticipo","values":null}]
  </code></pre>
  
  <p>Am I missing something or doing something wrong?</p>