I have a VideoController and inside of it there are 2 methods like the following:
[Route("api/Video/{id:int}")] public Video GetVideoByID(int id){ do something} [Route("api/Video/{id}")] public Video GetVideoByTitle(string id) {do something} The WebApiConfig.cs is like the following:
public const string DEFAULT_ROUTE_NAME = "MyDefaultRoute"; public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: DEFAULT_ROUTE_NAME, routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } So, when I comment out any of the method, the other one works, like if you totally comment out the 1st one, the 2nd method works, but both doesn't work when implemented. I used an Empty Web API template.
So any thoughts regarding why this is happening would be great.