I have the following code in my WebApiConfig.cs
config.Routes.MapHttpRoute( name: "Action", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } );
ABCController.cs
public class ABCController : ApiController { [AcceptVerbs("GET")] [ActionName("GetABCByXYZById")] public string GetABCByXYZById(int xYZId) { return "GetABCByXYZById"; } }
When I try to call the API it says not able to find the action in the controller.
/api/ABC/GetABCByXYZById/12