Getting another exception when I execute a query that uses a predicate description built with a FilterOperator of InList when the list is an intersected set of lists:
RemoteExceptionDetails:
System.ArgumentException: Invalid values for InList operation - Value must be of type: System.Collections.Generic.IList`1[System.Int32]
at IdeaBlade.Linq.PredicateDescription.Validate()
at IdeaBlade.Linq.PredicateDescription.Initialize(FilterOperator filterOp, Object value, Boolean ignoreCase)
at IdeaBlade.Linq.PredicateDescription..ctor(Type instanceType, String propertyPath, FilterOperator filterOp, Object value, Boolean ignoreCase)
at IdeaBlade.Linq.PredicateBuilder.Make(Type type, String propertyName, FilterOperator filterOp, Object value)
I have several queries that produce a set of distinct values and return their results into an IEnumerable<int>. If I just use this one single list of values in the predicate description, it works fine but if I combine them via the Intersect operation, it throws the error. All of these are server-side sync queries.
Take these obviously made-up queries to illustrate this against NorthwindIB:
// SQL
select Distinct ProductID from [Product] where UnitsInStock < 5
intersect
select Distinct ProductID from [Product] where CategoryID < 5
// and now DevForce
IEnumerable<int> productsFromUnits;
IEnumerable<int> productsFromCategoryull;
IEnumerable<int> commonProducts;
var propSelector = new PropertyProjectionSelector(typeof(Product), "ProductID");
productsFromUnits = EntityQuery.Create(typeof(Product)).Where(x => x.UnitsInStock < 5).Select(propSelector).Distinct().Execute().Cast<int>());
productsFromCategory = EntityQuery.Create(typeof(Product)).Where(x => x.CategoryID < 5).Select(propSelector).Distinct().Execute().Cast<int>());
commonProducts = productsFromUnits.Intersect(productsFromCategory);
var p = PredicateBuilder.Make(typeof(Product), "ProductID", FilterOperator.InList, commonProducts);
var q = EntityQuery.Create(typeof(Product).Where(p);
var results = manager.ExecuteQuery(q);
Again, I'm using build 6.1.2.0c.