<p>This question is addressed to a degree in this question on <a href="https://stackoverflow.com/questions/33664/best-practices-for-managing-linq-to-sql-dbml-files">LINQ to SQL .dbml best practices</a>, but I am not sure how to add to a question.</p>

<p>One of our applications uses LINQ to SQL and we have currently have one .dbml file for the entire database which is becoming difficult to manage.  We are looking at refactoring it a bit into separate files that are more module/functionality specific, but one problem is that many of the high level classes would have to be duplicated in several .dbml files as the associations can't be used across .dbml files (as far as I know), with the additional partial class code as well.</p>

<p>Has anyone grappled with this problem and what recommendations would you make?</p>

[{'answer_id': 42390, 'author': 'Guy', 'author_id': 1463, 'author_profile': 'https://Stackoverflow.com/users/1463', 'pm_score': 0, 'selected': False, 'text': "<p>The approach that we've used it to keep 2 .dbml files. One of them holds the Stored Procs and all production DB access is done through this. The other is in a unit test folder and holds tables and their relationships and is used for DB data manipulation and querying for unit tests.</p>\n"}, {'answer_id': 43109, 'author': 'liammclennan', 'author_id': 2785, 'author_profile': 'https://Stackoverflow.com/users/2785', 'pm_score': 1, 'selected': False, 'text': '<p>Past a certain size it probably becomes easier to work with the xml instead of the dbml designer.</p>\n'}, {'answer_id': 57222, 'author': 'Jarrett Meyer', 'author_id': 5834, 'author_profile': 'https://Stackoverflow.com/users/5834', 'pm_score': 2, 'selected': False, 'text': "<p>Take advantage of the namespace settings. You can get to it in properties from clicking in the white space of the ORM.</p>\n\n<p>This allows me to have a Users table and a User class for one set of business rules and a second (but the same data store) Users table and a User class for another set of business rules.</p>\n\n<p>Or, break up the library, which should also have the affect of changing the namespacing depending on your company's naming conventions. I've never worked on an enterprise app where I needed access to every single table.</p>\n"}, {'answer_id': 301304, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>I have written a utility to address exactly that problem, I needed a quick app to let you select only the database objects you need. In my case I often needed a complex view, but no tables.</p>\n\n<p><a href="http://www.codeplex.com/SqlMetalInclude/" rel="nofollow noreferrer">http://www.codeplex.com/SqlMetalInclude/</a></p>\n'}, {'answer_id': 326391, 'author': 'mcintyre321', 'author_id': 2086, 'author_profile': 'https://Stackoverflow.com/users/2086', 'pm_score': 1, 'selected': False, 'text': '<p>I have written a tool too! Mine is for scripting changes to dbml files using c# so you can rerun them and not lose changes. See my blog <a href="http://www.adverseconditionals.com" rel="nofollow noreferrer">http://www.adverseconditionals.com</a> 4 more details </p>\n'}]
['https://Stackoverflow.com/questions/42200', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4299/']