Skip to main content
added 252 characters in body
Source Link
Roman Marusyk
  • 24.8k
  • 27
  • 83
  • 127

You should add {action} to routeTemplate instead of {id} in the second configuration

config.Routes.MapHttpRoute( name: "DefaultActionApi", routeTemplate: "api/{controller}/{action}", defaults: new { action = "GetByQue" } ); 

also you can try to use route attribure on action :

[ActionName("GetByQue")] [Route("api/remote/GetByQue")] public IEnumerable<tblQue> GetQue() { //whatever } 

or change order(the second configuration and first configuration) of configuration in WebApiConfig.cs

You should add {action} to routeTemplate instead of {id} in the second configuration

config.Routes.MapHttpRoute( name: "DefaultActionApi", routeTemplate: "api/{controller}/{action}", defaults: new { action = "GetByQue" } ); 

You should add {action} to routeTemplate instead of {id} in the second configuration

config.Routes.MapHttpRoute( name: "DefaultActionApi", routeTemplate: "api/{controller}/{action}", defaults: new { action = "GetByQue" } ); 

also you can try to use route attribure on action :

[ActionName("GetByQue")] [Route("api/remote/GetByQue")] public IEnumerable<tblQue> GetQue() { //whatever } 

or change order(the second configuration and first configuration) of configuration in WebApiConfig.cs

Source Link
Roman Marusyk
  • 24.8k
  • 27
  • 83
  • 127

You should add {action} to routeTemplate instead of {id} in the second configuration

config.Routes.MapHttpRoute( name: "DefaultActionApi", routeTemplate: "api/{controller}/{action}", defaults: new { action = "GetByQue" } );