dbml diagram RRS feed

  • Question

  • I inherited a database with many tables and relationships.  As soon as I add all the tables into the dbml, the scene gets terribly complicated.  I find it difficult to look for the exact entity I'm interested in, much less its relationships with other entities.  It would be nice if it is possible to organize the entities into logical groups.  What is a good practice of doing that?  I found the below thread (circa 2007) which started off suggesting to simply create several dbml, one for each logical grouping of entities.  But it finished off with a concern that this is bad.  Are there any new ideas about this?  thanks.

    Friday, May 1, 2009 3:48 PM


  • There are a number of ways to deal with this:

    1) Maintain separate Linq-to-SQL models for each functional area within your database. Shared tables referenced from multiple parts of the database can either be duplicated in each model, or kept in their own L2S model and the relationships/navigation properties to/from those tables can be maintained manually in partial classes.

    2) One large L2S model, with multiple views/layouts. I have an add-in that makes this easier; it adds a new toolbar with a dropdown that allow you to switch view (and buttons for adding/modifying views) etc while still using the VS2008 L2S designer.

    The DBML Diagram View dropdown makes it easy to switch layout views in the Linq-to-SQL designer.

    If you want to try it out, you can download it and get a free 30-day trial license at http://www.huagati.com/dbmltools/

    Kristofer - Huagati Systems Co., Ltd. - www.huagati.com - Cool tools for Linq-to-SQL and Entity Framework: www.huagati.com/dbmltools
    Sunday, May 3, 2009 4:11 PM