Attribute routing in Web API doesn't support inheritance of the Route
attribute. You can see this indicated by Inherited = false
if you view the definition of the RouteAttribute
class...
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
public sealed class RouteAttribute : Attribute, IDirectRouteFactory, IHttpRouteInfoProvider
{ ...
This explains why you're getting the 404, as the Route
attribute effectively disappears.
Since the attribute is not inheritable and the class is sealed, I don't know if there's a way to do this with the attribute routing infrastructure that comes out of the box.
Update: A member of the Web API team explains it was a design decision that it's not inherited... https://stackoverflow.com/a/19989344/3199781