如何在ASP.Net MVC 2(VS2010)实体框架项目中自动生成简单的CRUD控制器和视图? [英] How to auto-generate simple CRUD controllers and views in ASP.Net MVC 2 (VS2010) Entity Framework project?

查看:195
本文介绍了如何在ASP.Net MVC 2(VS2010)实体框架项目中自动生成简单的CRUD控制器和视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个标准模板ASP.NET MVC 2 Web应用程序解决方案,一个空(意味着没有数据插入,但是所有的表都准备好等待)SQL Server数据库,一个Entity Framework 4模型(edmx)。有没有办法为模型中的所有实体生成简单的CRUD控制器和表单视图?

解决方案

我的答案 - 答案是使用ASP.NET动态数据实体Web应用程序而不是ASP.NET MVC 2 Web应用程序项目模板。其余的是1-2-3-容易,并在此解释: http:/ /msdn.microsoft.com/en-us/library/cc488469.aspx


I have a standard template "ASP.NET MVC 2 Web application" solution, an empty (meaning no data inserted, but with all tables etc. ready and waiting) SQL Server database, an Entity Framework 4 model (edmx). Is there a way to generate simple CRUD controllers and form views for all the entities in the model?

解决方案

A buddy out there helped me with the answer - the answer is to use a "ASP.NET Dynamic Data Entities Web Application" instead of "ASP.NET MVC 2 Web Application" project template. The rest is 1-2-3-easy and is explained here: http://msdn.microsoft.com/en-us/library/cc488469.aspx

这篇关于如何在ASP.Net MVC 2(VS2010)实体框架项目中自动生成简单的CRUD控制器和视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆