C
Chris
Trying to get my head around linq. Here is what I have:
Tables:
OrderHeader
OrderLineItem
OrderSubLineItem
The result set I need is:
OrderHeader.Description, Count(OrderSubLineItem) as CountAllItems
What I wanted to do is
var Result = from Item in DB.OrderHeader
where Item.OrderHeadID = ID
select new {Item.Description,
Item.OrderLineItem.OrderSubLineItem.Count}
I can't drill down from OrderLineItem to OrderSubLineItem though.
I am guaranteed that all LineItems have SubLineItems.
Also, I would like to return a dictonary of this and seem to have
having problems doing the ToDicontary when I do a select new at the
bottom of my LINQ.
Thanks
Chris
Tables:
OrderHeader
OrderLineItem
OrderSubLineItem
The result set I need is:
OrderHeader.Description, Count(OrderSubLineItem) as CountAllItems
What I wanted to do is
var Result = from Item in DB.OrderHeader
where Item.OrderHeadID = ID
select new {Item.Description,
Item.OrderLineItem.OrderSubLineItem.Count}
I can't drill down from OrderLineItem to OrderSubLineItem though.
I am guaranteed that all LineItems have SubLineItems.
Also, I would like to return a dictonary of this and seem to have
having problems doing the ToDicontary when I do a select new at the
bottom of my LINQ.
Thanks
Chris