We know that behind the scenes, the ASP.NET MVC framework will use reflection to determine what controllers/actions are available to be executed, based on which classes der
new ReflectedControllerDescriptor(typeof(TController)).GetCanonicalActions()
will return a collection of ActionDescriptor objects showing all the actions on the controller. It's not smart enough to understand things like selection attributes or naming attributes, so not every action it returns is guaranteed to be web-callable. But if you need to execute the actions directly, you can call ActionDescriptor.Execute() on any action of interest to you.
This is done in an internal
class in the System.Web.Mvc
assembly called System.Web.Mvc.ControllerTypeCache
.
By the way, action methods are not required to return ActionResult
. They can return void
happily, for instance.