I am trying to use GetMulti() but I think it is the wrong method!

Posts   
 
    
daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 03-Oct-2007 17:24:34   

Hi Everyone

I'm trying to use GetMulti(filter) to get a list of products back from my database - and to do this I'm doing the following:


PredicateExpression filter = new PredicateExpression();

// Specify which product we would like
filter.Add(Product.ProductId == m_iProductID);

// Make sure the item is in green
filter.AddWithAnd(ProductOptionProfile.ProductOptionID == 10);

// Make sure the item is in the size XL
filter.AddWithAnd(ProductOptionProfile.ProductOptionID == 15);

// Do our 'search' for availability
ProductCollection myproduct = new ProductCollection();
myproduct.GetMulti(filter);


When I do this, I get the error back that "ProductOptionProfile.ProductOptionID" could not be bound - which I am presuming is because you have to just specify child fields of the ObjectCollection you are trying to do a GetMulti for.

So... how can i do it confused

Many thanks in advance!

Darren

daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 03-Oct-2007 20:02:42   

I've been having a good read and I now think I know where I was going wrong.

I'll repost my new problem confused

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Oct-2007 03:43:53   

If you are filtering on a field related to your entityCollection to retrieve, you need to add the underlying relation. Then you pass the relation collection in the GetMulti call. wink

David Elizondo | LLBLGen Support Team