0

これは問題ありません、それは左結合を生成します

var q =
    from c in categories
    join p in products 
    on c equals p.Category into ps
    from p in ps.DefaultIfEmpty()
    select new { Category = c, ProductName = p == null ? "(No products)" : p.ProductName };

しかし、私がこのようなことをしたい場合はどうでしょうか:

...
on p.date between c.startdate and c.enddate
...
4

1 に答える 1

1
var q =
    from c in categories
    join p in products 
    on c equals p.Category into ps
    from p in ps.DefaultIfEmpty()
    where p.date >= c.startdate && p.date <= c.enddate
    select new { Category = c, ProductName = p == null ? "(No products)" : p.ProductName };
于 2010-03-15T14:33:51.940 に答える