title: Asp.net webapi enum parameter with default value
body: <p>I have a controller</p>
  
  <pre><code>   [HttpGet]
      [RoutePrefix("api/products/{productId}")] 
      public HttpResponseMessage Products(int productId,TypeEnum ptype=TypeEnum.Clothes)
  {
      if(!Enum.IsDefined(typeOf(TypeEnum),ptype))
        //throw bad request exception
      else
        //continue processing
  }
  </code></pre>
  
  <p>Myenum is declared as</p>
  
  <pre><code>public TypeEnum
  {
    Clothes,
    Toys,
    Electronics
  }
  </code></pre>
  
  <p>Currently if,some garbage value is passed it is getting converted into default value.
   What I want to do is if i call the controller as api/products/1 then the ptype should be assigned default value i.e clothes. If I call the controller as api/products/1?pType=somegarbagevalue then the controller should throw bad request exception. How can I achieve this?</p>