Where to place the entity framework in our solution?

a 夏天 提交于 2019-12-01 04:06:34

问题


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?


回答1:


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.




回答2:


I might be misunderstanding your question, but the thing I would suggest first off is to create a new project for your entity framework.

Is there a good reason for it to be in with the other projects? Keeping it separate keeps it small, and easier to manage. Also keeps the dependencies down.



来源:https://stackoverflow.com/questions/5558996/where-to-place-the-entity-framework-in-our-solution

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