What I have is about 7 tables, all in a 1:n relation. I have a filter list (combobox) where I select the parent, and I store all the separate collections in a dictionary:
Dictionary<ManageableEntityType, IEntityCollection> _entityCollections;
(ManageableEntityType is a custom enum containing all the supported entity types).
Then, I dynamically create a predicate and use the _CreateView _method to create a view on the collection with a filter to the selected parent. This does not work when a new entity has just been added (then, the item is not filtered).
What I am trying now is to register the parent type for each collection as well in a custom class. Then, I know which parent to use and which collection of that parent to use. It seems to work good that way, but requires some additional code. I hoped it was possible to create a predicate something like this:
new PredicateExpression(OrderFields.Customer == Customer);
instead of
new PredicateExpression(OrderFields.CustomerID == CustomerID);