How can possible to call different-different action on basis of parameter name using single route.
I need following
/api/v1/user
GET
key=dfddg&secret=fafassaf&query=select id from user where user like '%ggg%'
and
/api/v1/user
GET
key=dfddg&secret=fafassaf&ids=fadfdafdsf,faffasfasfsf,asfasfasfasfas,asfasfasfasf
I have written following code
[RoutePrefix("api/v1/user")]
public class UserController : ApiController
{
[GET("")]
public String GetAllUsers(String key, String secret, String query)
{
return "GetAllUsers";
}
[GET("")]
public String GetLookupUserIds(String key, String secret, String ids)
{
return "GetLookupUserIds";
}
but first case working fine but second one throwing exception
{
"Message": "No HTTP resource was found that matches the request URI 'http://localhost:14823/api/v1/user?key=rhdgsdgdsr&secret=fhdgdgdfhdfh&ids=fdfdf,dfadfff'.",
"MessageDetail": "No action was found on the controller 'User' that matches the request."
}