craigmain wrote:
Hi,
That really is a pitty.
I think it is something that should be thought about.
The indexof operator also does a linear search of the entity list, which is really inefficient considering that primary keys are present in all the tables.
It's not that inefficient as you might think, as multi-field pk's will also be usable with the same mechanism. But an index could be helpful, although it should be an index based on the hashvalue of the PK, with per hashvalue buckets with entities with the same value (as the hashvalue in .NET can only be an int)
Client side filtering requires a sort of 'view' object I think, plus if you want to do filtering, you need indexes. Adding entities and creating indexes is slow, so that's why they're not build in, as the indexes might never be used. They're on the todo list though, however there is no fixed date set when they'll be implemented.
I also notice that it is quite difficult to intercept the add / remove operations in an entity list so as to maintain a list of keys.
Keep in mind that a list of keys is hard to maintain if you have entities with a compound (multi-field) PK.