title: Pass Enum Parameter to WebApi method
body: <p>Trying to pass enum type value to WebApi but it is accepting any value other than enum integers.</p>
  
  <p>can we restrict to accept only enum values?</p>
  
  <pre><code>public class ValuesController : ApiController
  {
      [HttpGet]
      [Route("api/getName/{Gender}")]
      public IEnumerable&lt;string&gt; Get(Gender gender)
      {
          Gender g = gender;
  
          return new string[] { "value1", "value2" };
      }
  }
  </code></pre>
  
  <p>Enum Value</p>
  
  <pre><code>public enum Gender
  {
      Male,
      FeMale
  }
  </code></pre>
  
  <p>Ex:</p>
  
  <ol>
  <li><a href="http://localhost:58984/api/getName/1" rel="nofollow noreferrer">http://localhost:58984/api/getName/1</a> - Resolving it to FeMale</li>
  <li><a href="http://localhost:58984/api/getName/6" rel="nofollow noreferrer">http://localhost:58984/api/getName/6</a> - it is accepting 6 but I would like to throw an exception.</li>
  </ol>