How to do joins in LINQ on multiple fields in single join

前端 未结 13 1923
小鲜肉
小鲜肉 2020-11-22 17:02

I need to do a LINQ2DataSet query that does a join on more than one field (as

var result = from x in entity
join y in entity2 
       on x.field1 = y.field1          


        
13条回答
  •  伪装坚强ぢ
    2020-11-22 17:57

    var result = from x in entity
                 join y in entity2
                 on new { X1= x.field1, X2= x.field2 } equals new { X1=y.field1, X2= y.field2 }
                 select new 
                 {
                   /// Columns
                  };
    

提交回复
热议问题