MusicStore 相当于当年的petshop ,是实践微软MVC的不错选择。我趁这段时间,打算实践一下MusicStore 3,以便在项目中使用。
涉及的内容:
· Overview andFile->New Project (项目搭建)
· Controllers (控件器)
· Views (using Razor) (Razor视图)
· Models and DataAccess (using Entity Framework Code-First, installed via NuGet)
· Edit Forms andTemplating (Form编辑)
· Using DataAnnotations for Model Validation (验证)
· Membership andAuthorization (成员资格)
· Shopping Cart withAjax Updates (ajax使用)
· Registration andCheckout (注册)
· Final Updates toNavigation and Site Design, Conclusion
实际的一个效果:http://www.asp.net/mvc/tutorials/mvc-music-store-part-1,看前面的图片就可以了。
有几点注意:
1. 使用Razor engine;
2. 使用了Razor Layouts ,没有使用母版页面;
3. 数据访问是通过Entity Framework Code-First ;
4. 使用了NuGet 来安装和配置the Entity FrameworkCode-First library ;
5. 大量使用了ViewBag;里面能看到,ViewBag和ViewModels传输消息的示例;
6. 客户端一律使用jQuery和the MVC 3 unobtrusive Ajax ;
看不大明白吧?我也是,如果愿意,咱们一起来吧,哈哈....
weblogs.asp.net:http://weblogs.asp.net/jgalloway/archive/2011/02/03/learn-asp-net-mvc-3-with-the-mvc-music-store-tutorial.aspx
资源: http://mvcmusicstore.codeplex.com/