Thinking about the new preview of MVC…
So obviously this is related to actions on a controller returning a value instead of being a void.
As mentioned by ScottGu in his latest blog post on the changes in the next preview of MVC:
http://weblogs.asp.net/scottgu/archive/2008/04/16/asp-net-mvc-source-refresh-preview.aspx
Now generally I have a split opinion on this… from one side it really does seem like a great idea, but from other side somehow it just doesn’t feel right (don’t ask me why… it just doesn’t).
So I’ve been thinking that maybe it’s related to the way it’s written, it’s not that readable (IMHO). So without too much thinking (just throwing an idea out)… what do you think of something like this:
public class HomeController : Controller {
public ActionResult Index() {
ValueOfViewData["Title"] = “title”;
return toView();
}
public ActionResult About() {
return toAction(”Index”);
}
}
so just trying to express ourselves a little better (method names above are not that good, but should prove a point)?
Cheers!

Leave a Reply