title: ASP.Net MVC 4 WebAPI Custom Routing
body: <p>I have a controller called News in my WebAPI project, I have two default actions called Get that handled the following URL's:</p>
  
  <p>/api/News &lt;- this returns a list of news
  /api/News/123 &lt;- this returns a specific news item by id.</p>
  
  <p>All straightforward so far and obviously the default route handles these scenarios. I next want to have a URL that looks like this:</p>
  
  <p>/api/News/123/Artists &lt;- will return all artists related to the specified news item.</p>
  
  <p>Now I am fairly news to ASP.Net MVC and WebAPI so this is the first time I have had to deal with routing. I have modified my default route to look like this:</p>
  
  <pre><code>routes.MapRoute(
              name: "Default",
              url: "{controller}/{id}/{action}",
              defaults: new { controller = "News", action = "Get", id = UrlParameter.Optional }
  </code></pre>
  
  <p>So here I have moved the {action} to the end of the URL and I have added a Artists method to my News controller. This still works with the first two scenarios but returns a 404 for the third scenario.</p>
  
  <p>Obviously the routing isn't working for /api/News/123/Artists but I have no idea why.</p>
  
  <p>I can't seem to find any examples of people using WebAPI like this which makes me think I am doing something fundamentally wrong.</p>
  
  <p>Any help would be appreciated.</p>