I'm using 2.6, Adapter.
I want to be able to filter a FetchEntityCollection based on the rowcount of a related table. For example, I want all the orders that have 3 orderitems. I am pretty sure I need a FieldCompareExpressionPredicate for this, but I can't get it working. Here is what I have so far:
EntityCollection<OrderEntity> col = new EntityCollection<OrderEntity>();
IRelationPredicateBucket filter = new RelationPredicateBucket();
filter.Relations.Add(OrderEntity.Relations.OrderItemEntityUsingOrderd);
filter.PredicateExpression.Add(OrderItemFields.OrderItemId.SetAggregateFunction(AggregateFunction.CountRow) == 3);
daa.FetchEntityCollection(col, filter, null);
However, I get an exception about being unable to compare a Guid to an int...In this case OrderItemId is a Guid so I am guessing the system is choking on this field....Help?