How to auto-generate simple CRUD controllers and views in ASP.Net MVC 2 (VS2010) Entity Framework project?

旧巷老猫 提交于 2019-12-24 07:39:53

问题


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?


回答1:


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




回答2:


Hmm. His question was how to do this with MVC, not .NET. I too would like to hook up and generate MVC user forms from a Sql Server schema.



来源:https://stackoverflow.com/questions/2692624/how-to-auto-generate-simple-crud-controllers-and-views-in-asp-net-mvc-2-vs2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!