Click here to Skip to main content
15,890,995 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
can i do this without joining?

context.table1.where(i=>i.value1,i=>i.table2.value2)
Posted
Comments
Motamas 27-Feb-13 18:37pm    
Are they in a relation?
scorpzonex 27-Feb-13 23:16pm    
yes.
Motamas 28-Feb-13 3:15am    
The question what you want. The .where statement needs a predicate. For example you can use something like this:

context.table1.Include("table2").where(a => a.value = 10));

or

context.table1.Include("table2").SelectMany(a => a.Table2.Where(b => b.value = 20));

or

context.table1.Include("table2").SelectMany(a => a.Table2.Where(b => b.value = 20), (a,b) => new
{
item1 = a,
item2 = b
}
);
scorpzonex 28-Feb-13 8:47am    
thank you.
Motamas 28-Feb-13 9:39am    
Did it help?

1 solution

The question what you want. The .where statement needs a predicate. For example you can use something like this:

context.table1.Include("table2").where(a => a.value = 10)); 


or

C#
context.table1.Include("table2").SelectMany(a => a.Table2.Where(b => b.value = 20));


or

C#
context.table1.Include("table2").SelectMany(a => a.Table2.Where(b => b.value = 20), (a,b) => new { item1 = a, item2 = b } );
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900