I am a relative newbie to C # .Net (.net 4), EF4, Winforms and MVC3.
I created a database in SQL Server during the development of the Winforms backend for the task that I assigned. I set up one solution and create .edmx from the database as my own project / assembly in the solution. The solution also has a winforms application that references the .edmx assembly. Using the default EF4 code generation, I created a Winforms application, and everything is fine there.
Now I need to create an enduser frontend. I want to use MVC3. I went through the MVC3 tutorials on Pluralsight and a pretty decent understanding of MVC3 from that. But, both in this and elsewhere, most MVC3 + EF4 examples are the "first code."
My confusion is the best approach to integrate the EF4 database - first with MVC3? I looked at some on EF4Templates, but it seems they generate POCOs that are different from EF4 by default and will crash my Winforms application. I read some about repositories and using Automapper. I can add a reference to EF4 and my .edmx to the MVC3 project (same as with Winforms), but it seems that I still need to construct a controller / view model. Or can you just work directly with the EF4 classes by default controller?
Just find some recommendations on how to approach this with respect to MVC3.
Thanks!
Mark j bailey
source share