views:

36

answers:

1

I have a couple of queries with regards to entity framework:

  1. My database has over 100 tables including of master, lookup and child tables. One operation of save may save data in 25 different tables. I am trying to figure out the best possible way to organize my entities. Whether I should do table wise or should do it operation wise. Do we have any best practices or suggested practices defined in this regards?

  2. Since in the above scenario which do not have pure CRUD operations, should I keep one EDMX file or split them into multiple EDMX files and how?

A: 

Actually, there are no best practices concerning large models, it depends on personal experience.
As for the CRUD operations, here are some ideas:
You can either write a transactional code using TransactionScope, this approach will allow you table-level control.
In the different case you can write a set of stored procedures that will perform the complete operations. In this case wou will have an operation-level control.
As for EDMX splitting, this makes sense, e.g., in case your database has completely independent part.

Devart