Is it possible to perform joins across different databases using LINQ?

前端 未结 2 2048
天命终不由人
天命终不由人 2020-12-03 17:50

Is it possible to perform joins across different databases using LINQ? If yes then how?

相关标签:
2条回答
  • 2020-12-03 17:52

    calling .ToList() is querying all the records in db, so it will eat a lot of memory if there are a lot of records in tables.

    Or try this one The specified LINQ expression contains references to queries that are associated with different contexts.

    0 讨论(0)
  • 2020-12-03 18:06

    If the databases are on the same server, you can create views (and 3 part naming) so that all the tables are queryable from one database.

    If the databases are on different servers, you can use linked servers and views (and 4 part naming) so that all the tables are queryable from one database.

    0 讨论(0)
提交回复
热议问题