Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you create multiple .dbml/.edmx file for large database when using LINQ2SQL or Entity Framework?

When creating .dbml/.edmx for a database which has a lot of tables, do you use multiple .dbml /.edmx file or just a single giant file?

Any pro/cons for splitting the model into multiple file?

Thanks, J.W.

like image 643
J.W. Avatar asked Nov 06 '22 20:11

J.W.


2 Answers

For Linq-to-SQL, there are a number of alternatives which allow you to create more granular sets of files, rather than one single HUGE file.

Check out PLINQO - a CodeSmith template set - http://www.plinqo.com - very well done, allows you to update your model from the database, and creates one code file per object class.

Marc

like image 158
marc_s Avatar answered Nov 16 '22 11:11

marc_s


I just go for one per database. Then there are less contexts to manage and you won't ever face the scenario of realising that you need to create a relationship on two entities that you've put in separate files.

like image 24
burnside Avatar answered Nov 16 '22 10:11

burnside