2

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.

Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
  • I usually hate these kind of comments, but I must say- linq-2-sql is NOT a recommended framework, not even by Micro$oft (they're going to abandon it in favor of Entity Framework). If you have a choice- go for something else (nHibernate totaly rocks). – J. Ed Apr 11 '11 at 11:48
  • @sJhonny: this is not true. It will not be dropped but it will be maintained in parrallel. If you do not have a lot of differences between your DB and your business object linq-2-sql is fine – Pleun Apr 11 '11 at 11:52

1 Answers1

1

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

Summary: just use one datacontext for you entire DB

Community
  • 1
  • 1
Pleun
  • 8,856
  • 2
  • 30
  • 50