Sick of Hard Coding Strings in Your MVC App?
This may not be news to anyone, but there's a cool utility project out there for MVC that allows you to avoid hard coding strings in your app.
For example, how many times have you written something like:
public ActionResult DoSomething()
{
//Do some work
return RedirectToAction("Home");
}
All the time, right? It's a pretty common approach. But wouldn't it be nice if you didn't have to worry about the Action 'Home' being removed or renamed? T4MVC to the rescue.T4MVC is basically a code generator that looks at your MVC project and generates code that you can use. So, in the code of the example above, you could write something like:
public ActionResult DoSomething()
{
//Do some work
return RedirectToAction(T4MVC_SomeController.s_views.Home);
}
So, if 'Home' is renamed or removed, you'll get a compiler error and won't miss updating the code.
This is only one of many possible scenarios that T4MVC helps with. Please check out the project documentation to see if it can help you.
