For the following controller, a request like "/api/customers/GetAllCustomers1" is resulting in "Multiple actions found..." error
__Attached__ a standalone katana repro.
```
[Route("api/customers/{action}")]
public class CustomersController : ApiController
{
public string GetAllCustomers1()
{
return "GetAllCustomers1";
}
public string GetAllCustomers2()
{
return "GetAllCustomers2";
}
}
```
__Reason__:
We need to following similar approach like convention routing does for '{action}' variable. Interesting piece of code:
ApiControllerActionSelector source:
```
if (routeData.Values.TryGetValue(RouteKeys.ActionKey, out actionName))
{
// We have an explicit {action} value, do traditional binding. Just lookup by actionName
ReflectedHttpActionDescriptor[] actionsFoundByName = _standardActionNameMapping[actionName].ToArray();
// Throws HttpResponseException with NotFound status because no action matches the Name
if (actionsFoundByName.Length == 0)
{
throw new HttpResponseException(controllerContext.Request.CreateErrorResponse(
HttpStatusCode.NotFound,
Error.Format(SRResources.ResourceNotFound, controllerContext.Request.RequestUri),
Error.Format(SRResources.ApiControllerActionSelector_ActionNameNotFound, _controllerDescriptor.ControllerName, actionName)));
}
```
__Attached__ a standalone katana repro.
```
[Route("api/customers/{action}")]
public class CustomersController : ApiController
{
public string GetAllCustomers1()
{
return "GetAllCustomers1";
}
public string GetAllCustomers2()
{
return "GetAllCustomers2";
}
}
```
__Reason__:
We need to following similar approach like convention routing does for '{action}' variable. Interesting piece of code:
ApiControllerActionSelector source:
```
if (routeData.Values.TryGetValue(RouteKeys.ActionKey, out actionName))
{
// We have an explicit {action} value, do traditional binding. Just lookup by actionName
ReflectedHttpActionDescriptor[] actionsFoundByName = _standardActionNameMapping[actionName].ToArray();
// Throws HttpResponseException with NotFound status because no action matches the Name
if (actionsFoundByName.Length == 0)
{
throw new HttpResponseException(controllerContext.Request.CreateErrorResponse(
HttpStatusCode.NotFound,
Error.Format(SRResources.ResourceNotFound, controllerContext.Request.RequestUri),
Error.Format(SRResources.ApiControllerActionSelector_ActionNameNotFound, _controllerDescriptor.ControllerName, actionName)));
}
```