title: ASP.NET Web API 2 primitive type from body (boolean) error
body: <p>I have an action </p>
  
  <pre><code>[HttpPatch]
  public IHttpActionResult foo(int id, [FromBody]bool boolVariable)
  {
   return Ok();
  }
  </code></pre>
  
  <p>I am still debugging and when I try to send some data with Postman I get a strange error</p>
  
  <blockquote>
    <p>"Message": "The request is invalid.",
        "MessageDetail": "The parameters dictionary contains a null entry for parameter 'boolVariable' of non-nullable type 'System.Boolean' for
    method 'System.Web.Http.IHttpActionResult foo(Int32,
    Boolean)' in 'ProjectName.Controllers.NameController'. An optional
    parameter must be a reference type, a nullable type, or be declared as
    an optional parameter."</p>
  </blockquote>
  
  <p>The problem is that it isn't binding boolVariable with my json body... yea I can easily solve the problem with a bind model</p>
  
  <pre><code>  public class FooBindModel
      {
          public bool boolVariable{ get; set; }
      }
  
  
  public IHttpActionResult foo(int id, FooBindModel bindModel)
  {
   return Ok();
  }
  </code></pre>
  
  <p>However it's bugging me why doesn't it bind the variable from the json's body? I am specifying [FromBody] in the action parameters...</p>