0

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.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Chaddeus
  • 13,134
  • 29
  • 104
  • 162

1 Answers1

1

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

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • 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. – Chaddeus Sep 29 '10 at 23:09
  • 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 Sep 30 '10 at 05:56
  • I really appreciate your support. – Chaddeus Sep 30 '10 at 06:56
  • This is genius, T4MVC is plain awesome. Thank you for making this. – Chaddeus Sep 30 '10 at 08:37