title: Can I somehow support MVC 4 action parameter binding behaviour in ASP.NET Core 2.1?
body: <p>I am migrating ASP.NET MVC 4 application to ASP.NET Core 2.1 and almost everything is going well by far.</p>
  
  <p>I have a controller with an action which looks like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class SomeApiController : Controller
  {
      public ActionResult Post(Model model, int key1, string key2)
      {
          model.Key1 = key1;
          model.Key2 = key2;
          return Json(model);
      }
  }
  </code></pre>
  
  <p>The <code>Model</code> is:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Model
  {
      public string Text { get; set; }
      public int Number { get; set; }
      public int Key1 { get; set; }
      public string Key2 { get; set; }
  }
  </code></pre>
  
  <p>I can send a json body that contains any of <code>Model</code>'s properties with combination of query parameters and MVC 4 will always correctly bind body to <code>model</code>, <code>key1</code> and <code>key2</code>. </p>
  
  <p>The most needed type of request that works in MVC 4 looks like this:</p>
  
  <pre><code>POST /SomeApi/Post
  
  {
      "model": {
          "text": "some-text",
          "number": 1
      },
      "key1": 42,
      "key2": "some-text-2"
  }
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code>POST /SomeApi/Post?key1=42&amp;key2=some-text-2
  
  {
      "model": {
          "text": "some-text",
          "number": 1
      }
  }
  </code></pre>
  
  <p>Please pay attention to nested <code>model</code> value in json. </p>
  
  <p>This will be correctly bound to appropriate action parameters, but it <strong>does not on ASP.NET Core 2.1</strong>, at least by default.</p>
  
  <p>What is obviously working in ASp.NET Core 2.1:</p>
  
  <pre><code>POST /SomeApi/Post?key1=42&amp;key2=some-text-2
  
  {
      "text": "some-text",
      "number": 1
  }
  </code></pre>
  
  <hr>
  
  <p>Question: can I somehow support MVC 4 binding behaviour in ASP.NET Core 2.1 so I don't need to rewrite huge amount of frontend requests and/or backend modeling?</p>