How can I write a query to get data from 2 (or more) tables from different databases with EF Core? I have now the following code:
var items = (
from o in _db1.Orders
join c in _db2.Customers on o.CustomerId equals c.CustomerId
where c.CustomerId = 1
select c;
).ToList();
In MySql I have this query that needs to be transformed to the expression above (Linq
).
SELECT c.*
FROM db1.Customers c
JOIN db2.Orders o ON c.CustomerId = o.CustomerId
WHERE c.CustomerId = 1;
Please help
This scenario is not supported as of today and there are no plans to support it
This and other related features are mentioned at the end of this EF Core issue