Search code examples
linq-to-sqldatabase-designdatacontextmodularity

Data contexts - Linq to SQL


No one has taught me how to use these, and I can't find much on how I should be using them properly.

At the moment I say have a data context for my users, user details, user profiles etc. I then have a separate one for my help centre, holding tickets, ticket replies and ticket attachments etc.

Is this correct? Should I be splitting them like this? I cant create an association between two data contexts apparently in the designer. Should all tables be in just one data context? Any benefit to splitting them up? The tables in them are not fully independent of each other.


Solution

  • Have a look here at another Stackoverflow question: Linq-to-SQL: how many datacontexts?

    Summary: just use one datacontext for you entire DB