Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to place the entity framework in our solution?

Okay, so we have a solution that contains the following projects:

  • BusinessLogic
  • Entities
  • DataAccess
  • Utilities
  • UnitTests
  • UserInterface

It is a very large enterprise-level application. My question is, where do we put the entity framework? On one hand EF seems like a data access technology and should go in the DataAccess project. But then on the other hand it generates its own entities and those should be placed in our already large Entities project.

Which project is the better place for Entity Framework?

Is it possible to split up the entities from the persistence logic in EF?

like image 331
Chev Avatar asked Apr 05 '11 21:04

Chev


1 Answers

Place EDMX file to DataAccess. Add T4 template for entities and move it from DataAccess to Entities (you will probably have to modify path to EDMX in the template). It will work - I'm using it all the time.

Edit:

Here is Walktrhough for POCOs but it should be same with STEs.

like image 54
Ladislav Mrnka Avatar answered Nov 15 '22 06:11

Ladislav Mrnka