The scenario is that I want to support Wash action on all vehicle entities and I want to a different wash procedure for Car. Currently, it's not doable if I want to keep the same action name as wash.
If I define an action on Vehicle, and define two actions on VehiclesController: Wash() and WashOnCar(). It won't work. It will always fall back to Wash() because we use the action.EntityType to construct action name and it is always Vehicle.
If I define two actions in edm model, one on Vehicle and the other on Car, it will throw following exception:
{"Action resolution failed. Multiple actions matching the action identifier 'Wash' were found. The matching actions are: Default.Container.Wash, Default.Container.Wash.\r\nParameter name: actionIdentifier"}
at System.Web.Http.OData.Formatter.EdmLibHelpers.FindBindableAction(IEnumerable`1 functions, IEdmEntityType entityType, String actionIdentifier) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\OData\Formatter\EdmLibHelpers.cs:line 301
If I define an action on Vehicle, and define two actions on VehiclesController: Wash() and WashOnCar(). It won't work. It will always fall back to Wash() because we use the action.EntityType to construct action name and it is always Vehicle.
If I define two actions in edm model, one on Vehicle and the other on Car, it will throw following exception:
{"Action resolution failed. Multiple actions matching the action identifier 'Wash' were found. The matching actions are: Default.Container.Wash, Default.Container.Wash.\r\nParameter name: actionIdentifier"}
at System.Web.Http.OData.Formatter.EdmLibHelpers.FindBindableAction(IEnumerable`1 functions, IEdmEntityType entityType, String actionIdentifier) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\OData\Formatter\EdmLibHelpers.cs:line 301