Description
Synopsis
API version neutrality is defined by the IApiVersionNeutral marker interface. When this interface is applied by the ApiVersionNeutralAttribute it does not support inheritance. A service cannot be version-neutral in some cases and version-specific in others; therefore, once any implementation of a service is API version-neutral, all implementations are version-neutral. This behavior should be able to be realized through inheritance.
In ASP.NET Core, there is no distinction between a view-only controller and an API-only controller. View-only controllers typically never have API versions defined. Since there is no other way to identify or segregate these types of controllers, marking these types of controllers through inheritance is convenient.
Proposed Solution
Mark the ApiVersionNeutralAttribute as inherited. These will enable the following scenario:
[ApiVersionNeutral]
public abstract class UIController : Controller { }
[Route( "api/[controller]" )]
public class HelpController : UIController
{
[HttpGet]
public IActionResult Index() => Ok();
}