title: Attribute routing and inheritance
body: <p>I am playing around with the idea of having a base controller that uses a generic repository to provide the basic CRUD methods for my API controllers so that I don't have to duplicate the same basic code in each new controller.  But am running into problems with the routing attribute being recognized when it's in the base controller.  To show exactly what the problem I'm having I've created a really simple WebAPI controller.</p>
  
  <p>When I have a <code>Get</code> method in the main Controller and it inherits from the <code>ApiController</code> directly I don't have any problems and this works as expected.</p>
  
  <pre><code>[RoutePrefix("admin/test")]
  public class TestController : ApiController
  {
      [Route("{id:int:min(1)}")]
      public string Get(int id)
      {
          return "Success";
      }
  }
  </code></pre>
  
  <p>When I move the <code>Get</code> method into a base controller it is returning the contents of the 404 page.</p>
  
  <pre><code>[RoutePrefix("admin/test")]
  public class TestController : TestBaseController
  {
  
  }
  
  public class TestBaseController : ApiController
  {
      [Route("{id:int:min(1)}")]
      public string Get(int id)
      {
          return "Success";
      }
  }
  </code></pre>
  
  <p>Some more interesting notes:</p>
  
  <ul>
  <li><p>I can access the action at <code>GET</code> <code>/Test/1</code>.  So it is finding it based on the default route still.</p></li>
  <li><p>When I try to access <code>POST</code> <code>/admin/test</code>, it returns the following JSON</p>
  
  <p>{
  "Message":"No HTTP resource was found that matches the request URI '<a href="http://test.com/admin/test" rel="nofollow noreferrer">http://test.com/admin/test</a>'.",
  "MessageDetail":"No type was found that matches the controller named 'admin'."
  }</p></li>
  </ul>
  
  <p>Does anyone know of a way to get the routing to work with attributes from a base controller?</p>