title: ASP.NET Core Custom Authorization Attribute to inspect both Claims & Specific RouteValue
body: <p>I have a .NET Core Web API and am using IdentityServer4.</p>
  
  <p>I need to implement an Authorization Attribute which will check:</p>
  
  <ol>
  <li><p>Does the user have a Claim of type 'DealerId'.</p></li>
  <li><p>If so, does the value of this Claim == [specific parameter value sent to the Api]</p></li>
  </ol>
  
  <p>In an ideal world, I'd like to be able to do something like the following, however, I'm aware that in order to set that property within the attribute, it needs to be a constant value, and I can't simply specify the param from the requested method:</p>
  
  <pre><code>[ClaimRequirementAuthorization( DealerId = id)]
  public IEnumerable&lt;string&gt; GetDealer(int id){
  ...
  }
  </code></pre>
  
  <p>It also appears that some of the Authorization attribute stuff has changed in .NET Core, so am unsure of the most suitable approach to accomplish this.</p>