在我们的解决方案中将实体框架放置在哪里?
好的,我们有一个包含以下项目的解决方案:
- BusinessLogic
- Entities
- DataAccess
- Utilities
- UnitTests
- UserInterface
这是一个非常大的企业级应用程序。我的问题是,我们把实体框架放在哪里?一方面,EF 看起来像是一种数据访问技术,应该纳入 DataAccess 项目。但另一方面,它会生成自己的实体,并且这些实体应该放置在我们已经很大的实体项目中。
哪个项目更适合实体框架?
是否可以将实体从 EF 中的持久性逻辑中分离出来?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将 EDMX 文件放置到 DataAccess。为实体添加 T4 模板并将其从 DataAccess 移至实体(您可能需要修改模板中 EDMX 的路径)。它会起作用的——我一直在使用它。
编辑:
这里是 针对 POCO 进行遍历,但与 STE 应该相同。
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.
我可能会误解你的问题,但我首先建议的是为你的实体框架创建一个新项目。
是否有充分的理由将其与其他项目放在一起?将其分开可以使其变小并且更易于管理。还可以降低依赖性。
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.