I have an Customer collection. Inside Customer I have another collection called Orders.
Order have Name, OrderDate, PurchaseID.
How do write a Linq query to give me a new customer collection that only contain Orders that have OrderDate > QueryDate?
To aid with the discussion here is the relevant set of the code. I just need to understand the concept.
class Customer
{
List<Order> Orders;
}
class Order
{
string Name;
Date OrderDate;
int PurchaseID;
}
List<Customer> customers;
I am running into a new roadblock that I wasn't aware of. Orders is a readonly property. It need to be access via customers.Orders.Add(...) if not SharePoint answer would work. So how do add only the filtered Orders into Orders?