I'm trying to sort a list of orders and items based on a the earliest (lowest) creation date of one of the items in the list.
So I have:
public MyOrder
{
orderid int;
IList<MyItems> orderitems;
}
public MyItems
{
DateTime itemcreatedate;
}
Say Order1 has two items in it with itemcreatedate 6/1/2010 and 6/15/2010
Order2 has two items in it with itemcreatedate 4/1/2010 and 6/10/2010
I'd like my sorted list to then be Order2, Order1
My meager unfrozen caveman developer brain can see a brute force iterative way to make it happen, but I'm wondering if anyone has a nice clean way.