Error in Filter in LLBLGen 1.x Application

Posts   
 
    
larkydoo
User
Posts: 45
Joined: 30-Jun-2008
# Posted on: 04-Sep-2008 17:24:15   

I'm getting the following error in attempting to instantiate a filter for a getmulti:

CS0121: The call is ambiguous between the following methods or properties: 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField.operator ==(SD.LLBLGen.Pro.ORMSupportClasses.EntityField, System.Collections.ArrayList)' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField.operator ==(SD.LLBLGen.Pro.ORMSupportClasses.EntityField, SD.LLBLGen.Pro.ORMSupportClasses.Expression)'

My code is as follows:

    OfferingsCollection myOfferings = new OfferingsCollection();
    IPredicateExpression filter = new PredicateExpression();
    filter.Add(OfferingsFields.TerminationDate == null);
    myOfferings.GetMulti(filter);

it is erroring out on the filter.add statement.

Any help would be much appreciated.

Thanks.

Laurie

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Sep-2008 04:16:29   

Hi Laurie,

From your previous threads I assume you are using LLBLGen Pro v2.0. So, this is the way you should do that:

// C#
filter.Add(new FieldCompareNullPredicate(OfferingsFields.TerminationDate));
    
// which is equal to:
filter.Add((OfferingsFields.TerminationDate==System.DBNull.Value));
David Elizondo | LLBLGen Support Team
larkydoo
User
Posts: 45
Joined: 30-Jun-2008
# Posted on: 05-Sep-2008 14:56:55   

Actually, this is an older project using 1.0.2005.1. The code you sent, however, does seem to work. Thanks.