In a WEB API controller, can we have the same method name with different HTTP Verbs?
[HttpGet]
public string Test()
{
return \"
In config file don't break your default route.
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
And I solve that problem with that way. Just use that lines before your methods start.
[Route("api/Test")]
[Route("api/Test/{id}")]