8

Folks,

As of today should I introduce T4MVC in my project or use strongly typed goodness from MvcContrib?

return RedirectToAction(MVC.MyController.MyAction());

or

return RedirectToAction<MyController>(c => c.MyAction());

Trying to stick with standard/mainstream and stay up to date.

I know, there are Q&A on this site, I am interested to hear what is latest & greatest, rather than what was 2 years ago.

Thanks in advance.

Display Name
  • 4,672
  • 1
  • 33
  • 43
  • We are using ReSharper 6 in all of our MVC projects and with the [MVC support](http://www.jetbrains.com/resharper/features/asp_net_editor.html) and nice refactoring tools we never had any problems with using strings as action and controller names. So 1 vote for none of them :) – nemesv Aug 15 '12 at 15:21
  • @nemesv Thanks, good observation. Sorry for leaving no choice, I didn't really consider this option having used to externalize every possible magic from applications. I am coming from non-web world, so its understandable. Thanks again. – Display Name Aug 15 '12 at 15:26
  • Resharper doesn't cater to HtmlHelper.GenerateLink, etc, which is a larger pain point of refactoring than Redirect methods. – Jeff Dunlop Nov 22 '13 at 14:38

1 Answers1

5

Both techniques are acceptable today and I haven't heard that one would be deprecated. T4MVC has the advantage of performing better which is one of the reasons why those strongly typed helpers taking lambda expressions are actually not part of the ASP.NET MVC core.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • thanks for prompt response. Does it mean T4MVC is a clear-cut choice, or it has some disadvantages? or ask another way, if there's T4MVC around, why strongly typed helpers are even created? – Display Name Aug 15 '12 at 15:17
  • 1
    Those are subjective questions that I cannot answer. Some people prefer T4MVC, others prefer the strongly typed helpers and some are just happy with magic strings. – Darin Dimitrov Aug 15 '12 at 15:18