title: Passing List object and int to web api
body: <p>I have a web api core project that if I send just the list parameter than the API receives the values, however if I send both parameters that the controller is looking for then both parameters are seen as null</p>
  <p>My contoller:</p>
  <pre><code>[HttpPost]
  [Route(&quot;/jobApi/RunBD&quot;)]
  public int RunBDReport([FromBody]int month, [FromBody] IEnumerable&lt;ClientModel&gt; clients)
  {
      billingDetailCycle objBillDetail = new billingDetailCycle();
      if (ModelState.IsValid)
      {
         return objBillDetail.Run(clients.ToList(), month);
      }
      else
      {
          return 500;
      }
  }
  </code></pre>
  <p>ClientModel:</p>
  <pre><code>public class ClientModel
  {
      public string BlockOfBus { get; set; }
      public string ClientId { get; set; }
      public string Location { get; set; }
      public string SuppressSsn { get; set; }
  }
  </code></pre>
  <p>The request I am sending:</p>
  <pre><code>{&quot;month&quot;:7,
  &quot;ClientModel&quot;:[{&quot;blockOfBus&quot;:&quot;XXX&quot;,
  &quot;clientId&quot;:&quot;123456&quot;,
  &quot;location&quot;:&quot;&quot;,
  &quot;suppressSsn&quot;:&quot;N&quot;}]}
  </code></pre>
  <p>This causes both parameters to be seen as null by the controller, however if I send my request like this:</p>
  <pre><code>[{&quot;blockOfBus&quot;:&quot;XXX&quot;,
  &quot;clientId&quot;:&quot;123456&quot;,
  &quot;location&quot;:&quot;&quot;,
  &quot;suppressSsn&quot;:&quot;N&quot;}]
  </code></pre>
  <p>Then the controller is able to see the list object I am sending (however it obviously returns 500 as the model is not valid)</p>