如何在linq中实现内部联接?

时间:2009-04-23 17:56:18

标签: vb.net linq

给定两个表,即客户和订单,如何对实体进行linq查询以查找在特定日期之前开立的未结发票的客户?

1 个答案:

答案 0 :(得分:1)

VB.net

Dim query = _
    From customer In customers _
    From order In orders _
    Where customer.CustomerID = order.Customer.CustomerID _
    And order.OrderDate <=  dtOrderDate _
    And order.IsOpen = True _
    Select New With _
    { _
        CustomerID = customer.CustomerID, _
        OrderID = order.SalesOrderID, _
        Total = order.TotalDue _
    }

我修改了Query Expression Syntax Examples

中的代码

我从Linq to entites site

那里到达那里