tags:

views:

21

answers:

1

Just added the T4MVC templates to my project, built and then tried to use the cool new features it introduces.

I tried to update RedirectToAction("NotFound", "Error");

to RedirectToAction(MVC.Error.NotFound);

I get the following error at build:

Argument 1: cannot convert from 'method group' to 'System.Web.Mvc.ActionResult'

Also, in my views, when I try to do something like this: <%= Url.Action(MVC.Home.Index) %>

I get messages that say:

argument type 'method group' is not assignable to parameter type 'System.Web.Mvc.ActionResult'

Not really sure where to begin troubleshooting this.

+1  A: 

You need to call it like the action method. e.g. MVC.Error.NotFound(). See the doc for more examples.

David Ebbo
Wow, guess I was having a blond moment! I'm not at a place where I can test this... will update this question later. Thanks for the super fast response.
Chad
It's actually a common mistake when first using it, because it feels a little strange to call a method. Needless to say, it's not actually calling your action. But it looks like it!
David Ebbo
I really appreciate your support.
Chad
This is genius, T4MVC is plain awesome. Thank you for making this.
Chad