Multiple / single * .edmx files per database

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 began several years ago, and then DataSets were used; now we are moving towards the relationships of the entity model. The model has been growing since we add more tables that we need to work with. Is this the right way to handle this? Should I have a SINGLE model file to create a single data context?

What are the disadvantages and how do you use the entity infrastructure with large databases (or shouldn't be used with large ones?

The disadvantages that I see are as follows:

  • Visual Studio 2010 starts to freeze when opening this large XML in the designer (maybe this is NOT a problem, because even with many tables it does not freeze for a long time).
  • It is difficult to find references in the model (although the F4 + properties of the window with a list of object names almost removes this search-related problem).

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

+6
c # database entity-framework wcf-data-services datacontext
source share
1 answer

I suspect you are not getting a lot of answers because this is not a big problem. Even in both of your shortcomings, you say that this is not a problem. Of course, EDM works great with large databases. I would say that the larger the database, the greater the need for an ORM solution.

However, you can have one model, divided into several files, if this helps you organize everything, for example, several .edmx files can make up a single data context.

Alternatively, if you can logically divide the model into isolated parts that can interact through interfaces, and then you need to directly connect to objects in the data context, which is good for managing the entity's data model, and also just for the main separation of problems.

+3
source share

All Articles