Are Multiple DataContext classes ever appropriate?

后端 未结 5 1935
别跟我提以往
别跟我提以往 2020-12-17 08:19

In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create DataContext classes (which is usually done using the designer in VS 2008). From the

5条回答
  •  醉梦人生
    2020-12-17 08:43

    In my experience with LINQ to SQL and LINQ to Entities a DataContext is synonymous to a connection to the database. So if you were to use multiple data stores you would need to use multiple DataContexts. My gut reaction is you wouldn't notice to much of a slow down with a DataContext that encompasses a large number of tables. If you did however you could always split the database logically at points where you can isolate tables that don't have any relationship to other sets of tables and create multiple contexts.

提交回复
热议问题