Ho do I create a RelationPredicateBucket that checks for NULL?

Posts   
 
    
lsberman
User
Posts: 16
Joined: 22-Feb-2006
# Posted on: 03-Apr-2007 18:09:25   

Hi! I'm trying to create a RelationPredicateBucket but I'm running into the following error:

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

I'm using the following code, with the error related to TocFields.ParentId on the third line:

RelationPredicateBucket filter = new RelationPredicateBucket(); IPredicateExpression expression = new PredicateExpression(); expression.Add(TocFields.ParentId == null); expression.AddWithAnd(TocFields.SectionId == sectionEntity.Id); filter.PredicateExpression.Add(expression);

lsberman
User
Posts: 16
Joined: 22-Feb-2006
# Posted on: 03-Apr-2007 19:41:55   

As it turns out the following works:

expression.Add(TocFields.ParentId == DBNull.Value);