Is there a way to use IN operator

Posts   
 
    
Praveen
User
Posts: 31
Joined: 09-Jan-2012
# Posted on: 07-Jun-2012 16:46:48   

Hi,

Is there a way to use IN operator while using FetchEntityCollection? My code is given below:

  public IList FindAll(IEntity2 obj, IRelationPredicateBucket filter, IPrefetchPath2 prefetchPath2, bool isEventBind)
        {
            using (var adapter = new DataAccessAdapter())
            {
                var entityCollection = new EntityCollection(obj.GetEntityFactory());
                adapter.FetchEntityCollection(entityCollection, filter, prefetchPath2);
                if (isEventBind)
                {
                    BindEvents(entityCollection);
                }
                return entityCollection.GetList();
            }
        }

Using linq will be bad situation since, we have too many records in the collection.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Jun-2012 17:40:07   

Sure, you'll need to use FieldCompareSetPredicate

In your code add it to:

filter.PredicateExpression.Add(new FieldCompareSetPredicate(......))