每个数据库的多/单*的.edmx文件 [英] Multiple/Single *.edmx files per database

查看:185
本文介绍了每个数据库的多/单*的.edmx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有通过ADO.net数据服务数据库交互的项目。数据库是很大(的近150桌与依赖的)。该项目始于几年前,并有再使用数据集;现在我们正在迈向实体模型关系。该模型的增长,因为我们增加我们需要更多的工作表。这是管理所有正确的方式?这意味着我应该有一个数据库模型文件有单独的数据上下文?

I have a project that interacts with a database through ADO.net Data Services. The database is large (almost 150 tables with dependencies). The project started a few years ago and there were DataSets used then; now we're moving towards entity model relationships. The model is growing since we are adding more tables we need to work with. Is this a right way to manage all that?. Meaning should I have a SINGLE database model file to have single data context?

什么是缺点,你如何使用Entity Framework和大?数据库(或者应该不会有大的人使用。

What are drawbacks and how do you use the entity framework with large databases (or should it not be used with large ones?

我看到的缺点是:


  • Visual Studio 2010中开始在设计师打开大型XML时(冻结
    也许这不是一个问题,因为即使有许多表不冻结时间长)。

  • 它变得很难找到b中的模型($ b $引用的虽然 F4 +性能对象名称窗口的下拉框几乎
    删除此搜索相关的问题
    的)。

  • Visual Studio 2010 starts to freeze when opening that large XML in the designer (maybe this is NOT a problem, because even with many tables it doesn't freeze for long time).
  • It becomes hard to find references in the model (though F4 + properties window's combobox of object names almost removes this search related problem).

PS,奇怪的是,没有一个答案。这个问题似乎是重要的,在简单的话我就改换?哪个更好,整个一个整体,大型数据库或者数据库的几个型号一个型号

PS, strange that no one answers. The question seems important and in simple words I'll just rephrase it: Which is better, one model of whole a whole, large database or several models of that database?

推荐答案

我怀疑你没有得到很多答案,因为它不是一个大问题。即使在这两个缺点,你你说他们是不是真正的问题。当然,EDM是优良的工作与大型数据库。我要说的数据库越大越需要一个ORM解决方案。

I suspect you aren't getting many answers because it's not a big problem. Even in both your disadvantages you say they're not really problems. Certainly EDM is fine working with big databases. I'd argue the larger the database the more the need for an ORM solution.

不过你可以在有多个文件,一个模型分割,如果这将有助于你保持组织的事情 - 即多的.edmx文件,可以构成一个单一的数据上下文

However you can have one model split over multiple files if that would help you keep things organised - i.e. multiple .edmx files can constitute a single data context.

另外,如果你能在逻辑上分割模式进入孤立的部分,可以通过接口进行交互而不是需要直接加入实体是好的两个管理实体数据模型,也只是关注基本分离的数据上下文。

Alternatively if you can logically split the model into isolated parts that can interact via interfaces rather then needing to directly join entities in the data context that is good for both managing the entity data model, and also just for basic separation of concerns.

这篇关于每个数据库的多/单*的.edmx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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