Problems with filtering

Posts   
 
    
kimkim
User
Posts: 19
Joined: 12-Sep-2007
# Posted on: 24-Sep-2007 11:59:11   

Hi,

I am new to LLBLGen and am trying to do something very simple: create a filter for a security group entity for a given ID (pRoleId). My code is as follows:

RelationPredicateBucket bucket = new RelationPredicateBucket(); IPredicateExpression filter = new PredicateExpression(); filter.Add(new FieldCompareValuePredicate(TsysSecurityGroupAssignFieldIndex.SecurityGroupId, ComparisonOperator.Equal, pRoleId)); bucket.PredicateExpression.Add(filter);

However, I am getting the following error when compiling my code:

'Argument 1 cannot convert from E.g.Tsms.Datalayer.TsysSecurityGroupAssignFiledIndex to Sd.LLBLGen.Pro.ORMSupportClasses.IEntityField'

How do I convert 'TsysSecurityGroupAssignFieldIndex.SecurityGroupId' into IEntityField?

I hope you can help,

Kimkim

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 24-Sep-2007 14:28:06   

RelationPredicateBucket bucket = new RelationPredicateBucket(TsysSecurityGroupAssignFields.SecurityGroupId == pRoleId);

you are trying to use the FieldIndex enum property. Instead use the [My]Fields class and reference the field. also above you'll notice I used the operator overloads.