A common pattern used by my team is to declare shared action methods in base class controllers, and then implement derived classes which take advantage of action methods declared in the base class. However, often my developers need to add additional parameters to existing actions or otherwise change the definition of an action declared in the base class.
To achieve this currently we override the base class method and apply the [NonAction] attribute, and then reimplement the action with the desired additional parameters.
This approach works, but leaves a lot of 'mess' in the derived controller and is not intuitive. To overcome this I would like to change the way action methods are selected by MVC so actions declared in derived classes take precedence over those declared in base classes. This is currently impossible without copying a lot of code from the MVC source.
Please modify the framework so the following classes are not internal:
* ActionMethodSelector
* ActionMethodSelectorBase
This should then allow me to override IsValidActionMethod to implement logic to prefer methods implemented in derived classes.
To achieve this currently we override the base class method and apply the [NonAction] attribute, and then reimplement the action with the desired additional parameters.
This approach works, but leaves a lot of 'mess' in the derived controller and is not intuitive. To overcome this I would like to change the way action methods are selected by MVC so actions declared in derived classes take precedence over those declared in base classes. This is currently impossible without copying a lot of code from the MVC source.
Please modify the framework so the following classes are not internal:
* ActionMethodSelector
* ActionMethodSelectorBase
This should then allow me to override IsValidActionMethod to implement logic to prefer methods implemented in derived classes.