Returning a subset of an entity collection from an already instantied instance

Posts   
 
    
KastroNYC
User
Posts: 96
Joined: 23-Jan-2006
# Posted on: 30-Apr-2006 19:50:06   

I'm using self-servicing:

I've got two entities Employee and Photo There is a one-to-many relationship so one employee can have many photo's.

Let's say I have this:


Dim x As Integer = frmSelectedEmployee.SelectedValue
Dim emp As EmployeeEntity(X)
Dim photos As PhotoCollection = emp.Photo


The telephone entity has a field named PhotoType which I want to filter on so that the photo collection will contain only those photo entities whose PhotoType = 3, how can I do that?

If I use photos.GetMulti(expression) at this point will that return a new collection or "trim" the collection I currently have instantiated?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 30-Apr-2006 22:50:26   

That's added in v2 using filtering on entitycollections, using entityviews. If you want to use it in v1.0, you've to manually traverse the collection and copy over the entities to a different collection.

Frans Bouma | Lead developer LLBLGen Pro
KastroNYC
User
Posts: 96
Joined: 23-Jan-2006
# Posted on: 30-Apr-2006 23:48:27   

Thank you. BTW v2 looks awesome, i'm testing it out now.