title: ASP .NET CORE simple parameter validation
body: <p>Is it possible to do some validation using attributes on simple parameters, like:</p>
  <pre><code>[HttpGet(&quot;test/{type}&quot;)]
  public ActionResult  GetSomeData([Range(0,2)]byte type)
  {
    if (!ModelState.IsValid)
    {
      // isValid is always TRUE
    }
    ...
  }
  </code></pre>
  <p>When you call <code>/controller/test/4</code>, <code>IsValid</code> is always <code>TRUE</code>.</p>
  <p>Is there a cleaner way to do that?</p>