System.Action and T4MVC routes

Oct 3, 2012 at 2:15 PM


I have the following:

 public virtual ActionResult Index() {
  Test test = new Test(); 
  test.Action(() => MVC.User.SignIn().ExecuteResult(ControllerContext));

  test.Action(() => MVC.Shared.Views.Message); // Does not compile

  return View();

public class Test {
  public void Action(Action action) {         
} // Test

I am trying to redirect to another Controller Action or Return a Specific View inside a System.Action.

Is there any way to do this? I also tried the following:

  test.Action(() => CallAction(MVC.User.SignIn());

  test.Action(() => RenderView(MVC.Shared.Views.Message)); // Does not compile

Where CallAction and RenderView are methods inside a BaseController which my controllers use.

I tried the various options with T4MVC but wasn't able to make this work.

It this possible? What options do I have?

Thank You,


Oct 3, 2012 at 6:06 PM

I'm not quite sure what you're trying to achieve here, but let's step back a bit. To make sure we distinguish general MVC issue from T4MVC specific thing, the first thing I would ask here is: if you were not using T4MVC, what would you write? From there, I should be able to help you with the T4MVC equivalent.