title: JSON post of complex type with two constructors
body: <p>I'm trying to send a JSON post to an MVC controller; my type is like this:</p>
  
  <pre><code>public class A
  {
      public string Name { get; set; }
      public List&lt;B&gt; list { get; set; }
  
      public class B
      {
          public string Name { get; set; }
  
          public B(C c)
          {
              ...
          }
  
          public B(D d)
          {
              ...
          }
      }
  }
  </code></pre>
  
  <p>The way I'm sending is:</p>
  
  <pre><code>var A = {};
  var B = {};
  A.Name = "testRe";
  
  A.list = [];
  B.Name = "testCat1";
  A.list.push(B);
  B = {};
  B.Name = "testCat2";
  A.list.push(B);
  
  $.ajax({
      url: "/ExportModels/saveRelease",
      contentType: 'application/json',
      dataType: 'json',
      type: "POST",
      data: JSON.stringify(A)
  }).done(function (result) {
  
  });
  </code></pre>
  
  <p>It all works well if the constructor for B would be a plain one but for my logic B can only have C or D objects (not both). But then I can't do post.</p>
  
  <p>Is there a way do do a JSON post for a type B object?</p>