Let's say I have an app with orders and order details. I am trying to figure out how to best set up the architecture so I can retrieve all order details for a particular order. It would seem elegant and intuitive to have a URL structure like this:
http://example.com/api/orders/{orderid}/orderdetails
I can register a route in global.asax:
System.Web.Routing.RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/orders/{orderid}/orderdetails",
defaults: new { orderid = System.Web.Http.RouteParameter.Optional }
);
But I can't figure out what method in the OrdersController class this maps to. What method signature does the above route expect in my controller class? For all I know, this isn't even valid, so feel free to recommend a different approach.