LinQ的 join ... on后面不能写逻辑运算符链接的复杂条件么?    var q = 
        from c in categories
        join p in products on c equals p.Category && xxx == yyy

解决方案 »

  1.   


    //参考这种语法
     var q=from a in table1
    join b in table2
    on a.field1 equals b.field1
    join c in table2
    on a.field2 equals c.field2
    select a;
      

  2.   


    这种写法我了解,但是on 后面不能写 && ,让我百思不得其解。
      

  3.   

    inner join 的话条件可以写在where里面
      

  4.   

    有。。 var q =  
      from c in categories
      join p in products on new{ c ,xxx}  equals  new{p.Category ,yyy}