Best way to approach tying in Entity Framework 4 (“Database First”) and MVC3

这一生的挚爱 提交于 2019-12-04 11:05:54

You could work directly with the default EF4 classes in a controller if you wanted. The tooling support in the MVC 3 Tools Update for adding and scaffolding controllers works with code first but you can also use an existing context from a .edmx if you want to work directly with the objects.

http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

If you would rather use a repository pattern in your application you can check out the MvcScaffolding package, some info about it can be found on Steve Sanderson's blog.

http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/

You could also create view models yourself if you wanted to go that route.

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