I have a very simple linq query that gets data from two datatables (orderHeader & OrderDetails) and joins them together. What I would like to do is take the order items for each order and pass them to a method for processing.
Here is the query:
var results = from orderHeader in dtOrderHeader.AsEnumerable()
join orderDetails in dtOrderDetails.AsEnumerable() on
orderHeader.Field<int>("order_ref") equals
orderDetails.Field<int>("order_id")
select new {
orderID = orderHeader.Field<int>("order_ref"),
orderItem = orderDetails.Field<string>("product_details")
};
What is the best way to iterate the results for each order?
Thanks