title: Avoiding null model in ASP.Net Web API when no posted properties match the model
body: <pre><code>[HttpPost, Route("foo")]
  public void DoStuff(FooModel args)
  {
      if(args == null) args = new FooModel();
  
      // ...
  }
  
  public class FooModel
  {
      public string Foo { get; set; }
      public string Bar { get; set; }
  }
  </code></pre>
  
  <p>When a POST request is sent to a Web API method and the HTTP request does not include any of the arguments that would populate the model, instead of passing an empty model to the action, Web API instead just passes null to the action, necessitating a null check against the model argument at the start of every action.</p>
  
  <p>I understand that the framework is probably trying to avoid an unnecessary object construction, but these are always lightweight classes with no specific functionality. It would save time and be more consistent if the model was constructed every time rather than trying to save some negligible fraction of a millisecond that would be the cost of just constructing the model object anyway and passing it to the action.</p>
  
  <p>How can I get the framework to always pass a constructed (non-null) model object to my actions, even if none of the associated properties were able to be populated?</p>
  
  <p>I'm using ASP.Net Web API 2.2.</p>