Get ActionResult and Controller Names

Jun 27, 2013 at 2:44 PM
Is it possible to get the action and controller names from a T4MVC Action result?
Jun 27, 2013 at 2:48 PM
Ah answer my own question
.GetT4MVCResult().Controller
.GetT4MVCResult().Action

by the look of it...
Coordinator
Jun 27, 2013 at 2:51 PM
Yes, though this is the first time I hear about someone needing this :)
Jun 27, 2013 at 2:53 PM
Edited Jun 27, 2013 at 2:54 PM
I'm using the SagePayMVC Library and this is setup to take strings for the action and the controller rather than an action result.
This allows me to still avoid the magic strings.

Thanks
Chris
Coordinator
Jun 27, 2013 at 3:00 PM
Then you should be able to use T4MVC constants instead, e.g. MVC.Home.Name and MVC.Home.ActionNames.Index. See 2.3 in the doc.
Jun 27, 2013 at 3:03 PM
Thanks David that looks clearer.