The only thing I can find when dealing with master/detail and LINQ is through databinding. However, I am using LINQ to query my data and will need to manually loop through results without the need for databinding. My final intent is to loop through a master result set, get a grouped list of children, and output the master/detail data as a hierchial structure in XML.
My illustration: I have a table called my_master_tbl and and it will be queried by a date. I have a child table called my_child_tbl which will be grouped by date, by the master id, and use sum() to total some fields. I'd like to link the grouped data to the master and loop through the master/detail in the most efficient way possible to export the results as xml. What is that way? The only way I can think of is to loop through the master, then query the grouped result set of the children based on master_id. Any better ideas would be appreciated.
Thank You.