DataContext across multiple databases

后端 未结 2 449
孤街浪徒
孤街浪徒 2021-01-07 07:18

I have an application that needs to join tables from multiple databases into a single LINQ-to-SQL query. Unfortunately, I have a separate DataContext class setup for each d

2条回答
  •  -上瘾入骨i
    2021-01-07 07:26

    A co-worker found a thread on another site [social.msdn.microsoft.com] that discusses this same issue. One discussed solution was to perform all joins in views in the "primary" database, and expose those views as objects in the application. That will probably work in my situation, since the majority of my data is in one database, and the small number of tables in the other databases are read-only.

提交回复
热议问题