将实体框架放在我们的解决方案中? [英] Where to place the entity framework in our solution?

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

问题描述

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




  • BusinessLogic

  • 实体

  • DataAccess

  • 实用程序

  • UnitTests

  • UserInterface



它是一个非常大的企业级应用程序。我的问题是,我们在哪里放置实体框架?一方面,EF似乎是一种数据访问技术,应该在DataAccess项目中。但是另一方面,它会生成自己的实体,那些应该放在我们已经很大的实体项目中。



哪个项目是Entity Framework的更好的地方? p>

是否可以从EF中的持久性逻辑分割实体?

解决方案

将EDMX文件放入DataAccess。为实体添加T4模板,并将其从DataAccess移动到实体(您可能需要修改模板中EDMX的路径)。它会工作 - 我一直在使用它。



编辑:



这里是 POCO的Walktrhough ,但它应该与STE相同。 p>

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?

解决方案

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.

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

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