All the views that I write are strongly-typed. I don't have to explain why this is important, since strong-typing is the main goal T4MVC tries to achieve.
Currently however, I'm using the following code in my controller action to return a view model to my view:
return this.View(new HomeViewModel());
But when I change the typing of my view to something else than
I get a runtime exception.
Is there a way to get compile-time support for this? I like the compiler to complain when my viewmodel doesn't match the view.
return this.Views.Index(new HomeViewModel());
Is there a way to return a ViewResult from a controller action method in a way that is type safe?