Entity framework joins
11,030
var q = from i in context.table1
join it in context.table2 on i.productID equals it.productID
where i.categoryID == it.categoryID and it.productCode = xyz
select i).Skip(value).Take(value));
Author by
user686483
Updated on June 04, 2022Comments
-
user686483 almost 2 years
I'm using the entity framework 4.0 and I'm having some issues with the syntax of my query. I'm trying to join 2 tables and pass a parameter to find the value at the same time.I would like find all of the products in table 2 by finding the correlating value in table 1.
Can someone help me out with syntax please?
Thanks in advance.
sample data
table 1
ID productID categoryID 361 571 16 362 572 17 363 573 16 364 574 19 365 575 26
table 2
productID productCode 571 sku 572 sku 573 sku 574 sku 575 sku var q = from i in context.table1 from it in context.table2 join <not sure> where i.categoryID == it.categoryID and < parameter > select e).Skip(value).Take(value)); foreach (var g in q) { Response.Write(g.productID); }