0

I'm trying to make a query using two tables from 2 different edmx files, but I keep getting

The specified LINQ expression contains references to queries that are associated with different contexts.

I've based my code on the other issue like this one here. So I came up with this code.

var IDs = (from product in db2.Products
           where product.amount != 6
           select new product.productId).ToArray();

var query = from item in db.Items
            join product in IDs
            on item.itemId equals product.productId
            where (item.itemFlag != "X" || item.itemFlag2 != "X" ) && item.itemId == product
            select item;

I'm getting an error on select new product.productId. It says 'record' is a variable but is used like a type.

Uwe Keim
  • 38,279
  • 56
  • 171
  • 280
sswswsw
  • 11
  • 2
  • Similar question: [LINQ query that includes two tables from two different edmx files](https://stackoverflow.com/a/7339159/9482050) – Ibram Reda Dec 16 '21 at 03:50

0 Answers0