I am using the ASP.Net Web API and I need to pass in a different number of parameters to the accions in my controllers, but I haven't found (I'm new to Web API) a specific way to indicate a route template for the different methods I might have in my controllers.
Currently I have this template.
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
I don't think I'll have to indicate a new template for each of the different methods I have in my controllers, do I?
As I told you, I'm really new to Web API and I haven't found much info about this , that's why I'd really apreciate if you could give me some advice or guidance.
EDIT
It seems that the best way to go will be passing in the parameters in the query string like this:
api/controller/action?parm1=val1&par2=val2&par3=val3
the problem is that I have no idea how to put this in a route template or how to retrive these values from the query string.