EF 4 with POCO in the class library as an MVC 2 model

I am learning Entity Framework 4 with POCO as my model for MVC2 web application. The reason I need the model code and data access code in a separate library is because I can share it with another web application that serves as a portal for our customers to access our data.

My question is: will I lose any of the typical functions of the MVC2 model by adding EF4 and POCO code to another project? Or maybe another way to ask about this is whether the MVC structure will work with the model level the same way if it is in a separate project or in the Models folder?

Edit: I forgot to mention that I use POCO and not the generated classes that you usually get with EF for each object.

+1
source share
1 answer

Single assembly projects for small projects only

I never liked the Models folder. I prefer to add separate layers / tiers to separate assemblies. The MVC project template simply makes a layered application in one assembly.

I prefer solutions from several projects:

  • Web is a web application with an interface, i.e. Asp.net MVC ( Services and Objects links )
  • Services - business-level assembly ( Data and Objects links )
  • Objects - POCO classes, interfaces, etc., which are shared (do not refer to any other solution project)
  • . EF , .. ( )

, , .

, : EF- ( ..) POCOs, . Objects.

,
, , ( ),
, , EF .
, , POCO .

, POCO ( 1:1) . , , , , POCO. , ToPoco() ( ).

+5

All Articles