Possible Duplicate:
How can I get controller type and action info from a url or from route data?
I have a list of controller names and their actions names. What I need to do is to read values from custom attributes on those actions.
The problem is that it seems there is no easy way to get controller types (Having that the rest is easy.)
ASP.NET MVC framework has this functionality in DefaultControllerFactory
, but it's not accessible outside of framework itself.
It doesn't look like a good idea to reinvent the wheel and implement it myself, especially because MVC framework has cache for controller types, which I would need to duplicate.
Is there any better solution?
Upd. Accessing the list of Controllers/Actions in an ASP.NET MVC application describes a similar, but different problem. I don't need to determine what controllers/actions are available to be executed, I need to get type of a single controller.