Trying to get my head around linq. Here is what I have:
Tables:
OrderHeader
OrderLineItem
OrderSubLineIte m
The result set I need is:
OrderHeader.Des cription, Count(OrderSubL ineItem) as CountAllItems
What I wanted to do is
var Result = from Item in DB.OrderHeader
where Item.OrderHeadI D = ID
select new {Item.Descripti on,
Item.OrderLineI tem.OrderSubLin eItem.Count}
I can't drill down from OrderLineItem to OrderSubLineIte m 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
OrderSubLineIte m
The result set I need is:
OrderHeader.Des cription, Count(OrderSubL ineItem) as CountAllItems
What I wanted to do is
var Result = from Item in DB.OrderHeader
where Item.OrderHeadI D = ID
select new {Item.Descripti on,
Item.OrderLineI tem.OrderSubLin eItem.Count}
I can't drill down from OrderLineItem to OrderSubLineIte m 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
Comment