Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LINQ Join with multiple AND conditions

I want to join two entities in my MVC application for data Processing through the LINQ join.

For that I am trying to write the query like,

from enumeration in db.Enumerations
join cust in db.Customers on ( enumeration.Value equals cust.lkpStatus &&       
enumeration.EnumerationTypeID.Contains('Cust')

But I am getting Problem with this Query, So please give me some suggestion on this.

like image 703
Rahul_RJ Avatar asked Nov 01 '13 07:11

Rahul_RJ


1 Answers

Join should be made like this:

var joinQuery =
from t1 in Table1
join t2 in Table2
  on new { t1.Column1, t1.Column2 } equals new { t2.Column1, t2.Column2 }
...
like image 65
IDeveloper Avatar answered Oct 12 '22 23:10

IDeveloper