IEntityFIeld2 versus IEntityField

Posts   
 
    
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 16-Jan-2008 22:23:12   

LLBLGen Pro version: 1.0.2004.2 Final Released: may 17th, 2005

.net 2.0

++++++++++++++++


  public static EntityCollection GetUsersNotInRole(int appId, int roleId)
        {
            DataAccessAdapter adapter = new DataAccessAdapter();

            EntityCollection coll = new EntityCollection(new UserEntityFactory());

            RelationPredicateBucket bucket = new RelationPredicateBucket();

            //add conditions
            bucket.PredicateExpression.Add(PredicateFactory.CompareValue(
                UserFieldIndex.ApplicationId, ComparisonOperator.Equal, appId));

            bucket.PredicateExpression.Add(new FieldCompareSetPredicate(
                EntityFieldFactory.Create(UserFieldIndex.UserId), null,
                EntityFieldFactory.Create(UserRoleFieldIndex.UserId),
                SetOperator.In, null));
            
            
            adapter.FetchEntityCollection(coll, bucket);

            coll.SupportsSorting = true;

            return coll;


        }

has compile error on this part:

bucket.PredicateExpression.Add(new FieldCompareSetPredicate(
                EntityFieldFactory.Create(UserFieldIndex.UserId), null,
                EntityFieldFactory.Create(UserRoleFieldIndex.UserId),
                SetOperator.In, null));

that says a few things like this:

Argument '1': cannot convert from 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField2' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField'

Attached is images of visual studio showing error. The documentation says that this is the proper call to adding a predicate to a bucket. Please assist.

Thanks.

Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 16-Jan-2008 23:01:16   

Ok, the vast number of parameters and overloads have blurred my vision. The following version compliles now:

bucket.PredicateExpression.Add(new FieldCompareSetPredicate(
                EntityFieldFactory.Create(UserFieldIndex.UserId), null,
                EntityFieldFactory.Create(UserRoleFieldIndex.UserId),null,
                SetOperator.In, null, true));

Issue resolved.