title: Class level Route in asp.net with variable
body: <p>Is it possible to have a class level <code>Route</code> that ends in a variable? 
  Ex: </p>
  
  <pre><code>[Route("api/{carType}")]
  public class CarController : Controller
  {
    ..rest of class
  }
  </code></pre>
  
  <p>and if so how would you access that variable? </p>
  
  <p>Or am I just thinking about this completely wrong? I have a couple of objects that all derive from the same abstract class and right now I have a different controller for each but they are all the same practically. I think it would be possible to have generic methods to handle everything but not sure the best way to interpret what type the object actually is. </p>
  
  <p>Ex: </p>
  
  <pre><code>[Route("api/{carType}")]
  public class CarController : Controller
  {
       [HttpGet()]
       public IActionResult GetCars()
       {
          IActionResult result; 
          switch(carType){
              case "Ford":
                 result = myService.GetCars&lt;Ford&gt;();
                 break;
              case "Toyota":
                 result = myService.GetCars&lt;Toyota&gt;();
                 break;
              ....
          }
          return result; 
       }
  }
  </code></pre>