title: MVC4 Get Route Data From ApiController
body: <p>I'm looking to grab the {contract} value out of my route when I hit my API controller.</p>
  
  <pre><code>config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{contract}/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  </code></pre>
  
  <p>So when a user hits /api/rearch/allergies/1234 I'd like to grab "rearch" and use it to fetch a connection string.  </p>
  
  <p>I've attempted using RouteData and RouteTable like below with no luck:</p>
  
  <pre><code>this.RouteData.Values["contract"].ToString() 
  RouteTable.Routes["contract"]
  </code></pre>
  
  <p>Is there something I'm missing?  Is this different in an ApiController?</p>
  
  <p>Thanks in advance!</p>