Finding entity in EntityCollectioin

Posts   
 
    
Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 28-Mar-2006 21:38:35   

How do I find an entity within a EntityCollection using an expression involving multiple fields (but not all) rather than the entity's primary key?

I'm looking through the documentation and can't find anything. There is a method called IndexOf() but it looks like it matches according to the PK of the passed entity.

I'm using self-servicing code.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 29-Mar-2006 04:32:33   

You would have to iterate through the collection and compare the involved fields to each entity until you found a match. There is no memory side querying of the entitycollections.

Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 29-Mar-2006 16:34:27   

OK, thanks bclubb. That's what I did but as I was coding it I thought for sure there must be a better way.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-Mar-2006 16:51:43   

Hold tight for our next version (v.2), there will be a way to filter an EntityCollection simple_smile

Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 29-Mar-2006 16:59:39   

Yipee! That is a nice addition.

Didn't I read somewhere that v2 would be released in Q1 which means I should be able to upgrade to v2 within 2 days - can't wait! wink

Seriously, is v2 going to be released within the next, say, 4 weeks? Knowing would help me plan my project a little bit better.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-Mar-2006 17:04:28   

We are expecting it to be released before May.

Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 29-Mar-2006 18:58:04   

Great. Thanks. I am looking forward to it!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 29-Mar-2006 19:24:56   

Walaa wrote:

We are expecting it to be released before May.

Beta version that is simple_smile (beta in april, release in may)

Frans Bouma | Lead developer LLBLGen Pro