开发者

ASP MVC/EF 4 Design - to use a viewmodel or not?

I have a list of somewh开发者_开发技巧at complex entity graphs representing video game reviews. I'm going to create separate navigation based on the graphs' properties - game title, platform name(s), genre. At the end, it will be Wiki-like.

What I'm wondering is this - should I do the work to grab this navigation info in my controller and store it all in a view model, or should I simply pass my list of graphs into the view, and manipulate it there? Does it matter, in this case?


IT is good convention to use a ViewModel when passing information to the views. ViewModel suggests a link to a View. In a perfect world then we would use 1 ViewModel per View

there is a great article by Jimmy Bogard (author of MVC 3 in Action) that could help here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜