Hi there
Lets say I have in-memory collections of two entity classes with an 1:n relation: An _EntityCollection<Customer>, _and each customer entity provides a property Orders of type EntityCollection<Order>.
What I want to do now is to create a view that only shows me some customers (e.g. all customers that start with "A") and of these customers, only some orders (e.g. all orders that were placed this year).
As far as I understand entity views, I can easily create a view that filters the customer collection, optionally even including constraints regarding related entities (the orders). However: Is there a way to get a result that also filters the _Orders _collections (automatically applies a filter to all _Order _collections of the filtered _Customer _entities?
myCustomerEntityCollection.CreateView(xxx);
Example: (get orders of 2008 of customers starting with "A")
Unfiltered data
Customer "Anne", Orders collection with 6 orders (2 this year)
Customer "Axel", Orders collection with 4 orders (3 this year)
Customer "Bart", Orders collection with 2 orders (1 this year)
Filtered data (both levels)
Anne, Orders property returns 2 orders
Axel, Orders property returns 3 orders
Thanks for your advice
Philipp