You can most definitely build a context database first. In fact one of the modes you can use Entity Framework is EF Database First. In this case you can just create an edmx file and drag your tables and it generates the data context for you http://msdn.microsoft.com/en-us/data/gg685489
CodeHobo
All-Star
18647 Points
2647 Posts
Re: MVC with Schema first
Apr 25, 2012 03:09 PM|LINK
You can most definitely build a context database first. In fact one of the modes you can use Entity Framework is EF Database First. In this case you can just create an edmx file and drag your tables and it generates the data context for you
http://msdn.microsoft.com/en-us/data/gg685489
If you don't want to use full fledged entities, you can still use EF code first models (raw pocos) with an existing database.
See this blog post on how to do that. ( you can easily modify th technique used in this post to work with mvc)
http://weblogs.asp.net/scottgu/archive/2010/08/03/using-ef-code-first-with-an-existing-database.aspx
Also check out
http://weblogs.asp.net/jgalloway/archive/2011/02/24/generating-ef-code-first-model-classes-from-an-existing-database.aspx
Blog | Twitter : @Hattan