For an already agreed (between customer and us) URL like,
http://URL/companyapi/orders/100191/sendrequest?for=customer123&card=123451
I am defining a route map like this:
public static void Register(HttpConfiguration config)
{
config.Routes.MapRoute(
name: "Service",
routeTemplate: "companyapi/orders/{orderId}/{controller},
default: new{},
);
}
For retrieving other query string parameters, I think it is enough if I do this:
public void Get(string for, int card)
{
// How to retrieve the orderId ?
}
1. How to retrieve the orderId because it comes before controller portion in the route Template?
2. Is it perfectly normal to leave the default part of the MapRoute function?