Ian wrote:
How do I do a join in a sub-query? The FieldCompareSetPredicate only seems to take a predicate so where would I specify a join?
Derived tables and Dynamic relations is designed for that.
Ian wrote:
Is there anything in the manual about writing sub-queries? I can't even get the FieldCompareSetPredicate constructor to compile because for its first parameter it wants an IEntityField instead of an IEntityField2!
You should use this overload (ref...):
public FieldCompareSetPredicate(
IEntityFieldCore field,
IFieldPersistenceInfo persistenceInfoField,
IEntityFieldCore setField,
IFieldPersistenceInfo persistenceInfoSetField,
SetOperator operatorToUse,
IPredicate filter)
For example:
FieldCompareSetPredicate subQueryFilter = new FieldCompareSetPredicate(
OrdersFields.OrderId, null, OrderDetailsFields.OrderId, null,
SetOperator.In, (OrderDetailsFields.UnitPrice > 1));
Ian wrote:
And what are the 'field' and 'setField' parameters for anyway?
See above "ref..." link.