title: receive abstract type in WebAPI as input
body: <p>I have the following WebAPI action insed a controller (example):</p>
  
  <pre><code>public MyAbstractClass Action1(MyAbstractClass input)
  {
      return input;
  }
  </code></pre>
  
  <p>the class structure is like so:</p>
  
  <pre><code>public class MyAbstractClass 
  {
     public int ID {get;set;}
     public string Name {get;set;}
  }
  
  public class ConcreteClass1 : MyAbstractClass 
  {
     public string Foo {get;set;}
  }
  
  public class ConcreteClass1 : MyAbstractClass 
  {
     public string Bar {get;set;}
  }
  </code></pre>
  
  <p>I wan to make a call to the WebAPI <code>Action1</code> with a JSON describing one of the concrete classes but it always returns null.</p>
  
  <p>I have set my formatter like this:</p>
  
  <pre><code>public static void Configure(MediaTypeFormatterCollection formatters)
  {
      var jsonFormatter = formatters.JsonFormatter;
      var settings = jsonFormatter.SerializerSettings;
  
      settings.Formatting = Formatting.Indented;
      settings.TypeNameHandling = TypeNameHandling.Objects;
      settings.ContractResolver = new CamelCaseExceptDictionaryKeysResolver();
  }
  
  private class CamelCaseExceptDictionaryKeysResolver : CamelCasePropertyNamesContractResolver
  {
      protected override JsonDictionaryContract CreateDictionaryContract(Type objectType)
      {
          JsonDictionaryContract contract = base.CreateDictionaryContract(objectType);
  
          contract.DictionaryKeyResolver = propertyName =&gt; propertyName;
  
          return contract;
      }
  }
  </code></pre>
  
  <p>NOTE i have a custom resolver and i have set <code>settings.TypeNameHandling = TypeNameHandling.Objects;</code></p>
  
  <p>so i send a post request witha JSON looking like this:</p>
  
  <pre><code>{
     "$type": "MyNameSpace.SubNameSpace.ConcreteClass1"
     "id":100,
     "name":"some name",
     "foo":"some value of foo..."
  }
  </code></pre>
  
  <p>and yet receive <code>null</code> as the output .. meaning the sterilizer is unable to deserilize the concrete class.</p>
  
  <p>what have i missed here ? </p>