Getting a collection of subtypes

Posts   
 
    
cjmos
User
Posts: 15
Joined: 04-May-2007
# Posted on: 17-Jul-2007 16:58:27   

Hi all,

I have implemented the following model

Cart -- CartItem (1:n)

CartItem ProductItem : CartItem EventItem: CartItem

I'm using the TargetPerEntity method to map this in LLBLGen

Is there a way to retreive a collection of entities based on there subtype without using a discriminator column? So can i do something like this?

CartEntity cart = new CartEntity(10); ProductItemCollection products = cart.SomeMethodToGetOnlyProductItemSubtypes()

Thanks in advance.

CM

Aurelien avatar
Aurelien
Support Team
Posts: 162
Joined: 28-Jun-2006
# Posted on: 17-Jul-2007 17:06:52   

Hi,

You can use the GetEntityTypeFilter() method as described in the "Filtering on entity type" section in the "Advanced filter usage" page

cjmos
User
Posts: 15
Joined: 04-May-2007
# Posted on: 17-Jul-2007 17:24:35   

Excellent, thanks.