Find Entity with values X and Y in EntityCollection

Posts   
 
    
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 26-Jan-2006 17:52:35   

I have an entity collection that is filled with entities. I want to find the entity in the collection where column1 = x and column2 = y, but there are 6 columns total in the entity, and I don't know the values for the other 4 columns. I know that I can iterate through the collection and compare for each one, but I also know that there must be a better way as Frans is a pretty smart dude. What are some other ways I could find this one?

P.S. I know how to use the Find method from the IBindingList but it only lets me search one property, right?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 26-Jan-2006 18:27:34   

Thanks for the convidence in my brainpower wink but in v1 there's no way to smartly search an entity collection without traversing it manually.

In v2 this will be available to you (using normal predicates). Till then, a manual loop it is, unfortunately.

Frans Bouma | Lead developer LLBLGen Pro
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 26-Jan-2006 19:29:24   

Well I suppose that half a "Yes" is better than a "No".

(I'll be holding my breath until end of the quarter)