Predicate Syntax

Posts   
 
    
Posts: 134
Joined: 10-Jan-2007
# Posted on: 17-Jan-2007 21:45:40   

Having a problem with Predicate syntax in VS.NET 2005, Self Servicing.

From the examples, this should work: IPredicateExpression select = new PredicateExpression(); select.Add(RoleFieldIndex.RoleName =="User Admin");

but I get a compile error: Operator '==' cannot be applied to operands of type 'NovaStar.Enterprise.RoleFieldIndex' and 'string'

I had to do this instead: IPredicateExpression select = new PredicateExpression(); select.Add(new FieldCompareValuePredicate(EntityFieldFactory.Create(RoleFieldIndex.RoleName), ComparisonOperator.Equal, "User Admin"));

What am I missing?

Brian

Posts: 134
Joined: 10-Jan-2007
# Posted on: 17-Jan-2007 21:53:40   

Answered myself: select.Add(RoleFields.RoleName =="User Admin");

RoleFields are different than RoleFieldIndex