I am trying to sort the list of orders and items based on the earliest (lowest) date of creation of one of the items in the list.
So, I have a:
public MyOrder { orderid int; IList<MyItems> orderitems; } public MyItems { DateTime itemcreatedate; }
Say Order1 has two elements in it: itemcreatedate 6/1/2010 and 6/15/2010
Order2 has two items in it since itemcreatedate on 4/1/2010 and 6/10/2010
I would like my sorted list to be Order2, Order1
My lean caveman non-freezing brain might see an iterative way of brute force for this to happen, but I wonder if anyone has a good clean way.
source share