LINQ - Nested Query

前端 未结 3 943
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 03:13

I have a SQL Statement that I am trying to convert to a LINQ query. I need to do this because I can\'t edit my database :(. Regardless, I have a SQL Statement that looks like th

3条回答
  •  孤独总比滥情好
    2021-01-21 03:40

    Just do a count off of the navigation property of "PurchaseOrders" that I assume is on the Customer entity.

    TotalPurchases = x.PurchaseOrders.Count()
    

提交回复
热议问题