I have a web API controller:
public List<mytable> Get(string filter1, string filter2){
...
}.
I need to create another method named
List<drpSubject> GetSubject(){
...
}.
My WebApiConfig.cs like this
public static void Register(HttpConfiguration config)
{
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
// routeTemplate: "api/{controller}/{id}",
routeTemplate: "{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.Routes.MapHttpRoute("DefaultApiWithAction", "{controller}/{action}");
}
But now I get error message "Multiple actions were found that match the request..." . It only works when there is one Get(). How to create web api that can take multiple actions? Thanks.