凡发生在我们的解决方案,实体框架? [英] Where to place the entity framework in our solution?

查看:130
本文介绍了凡发生在我们的解决方案,实体框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以我们有一个包含以下项目的解决方案:

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


  • BusinessLogic

  • 实体

  • 数据访问

  • 工具

  • 单元测试

  • 的UserInterface

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

这是一个非常大的企业级应用。我的问题是,在这里我们把实体框架?一方面EF似乎是一个数据访问技术,并在数据访问项目应该去。但在另一方面它产生自己的实体和那些应该被放置在我们现有大型实体项目。

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?

是否有可能分裂的持久性逻辑的实体EF?

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

推荐答案

广场EDMX文件数据访问。加入T4模板实体和它的数据访问移动到实体(你可能必须修改路径EDMX模板)。它将工作 - 我用这一切的时候。

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.

编辑:

下面是的Walktrhough为波苏斯的,但它应该是相同的与国营贸易。

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

这篇关于凡发生在我们的解决方案,实体框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆