AggregateOperand.Exists(CriteriaOperator) Method
Creates a new AggregateOperand which determines whether or not the count of AggregateOperand.CollectionProperty elements that match the AggregateOperand.Condition is greater than zero.
Namespace: DevExpress.Data.Filtering
Assembly: DevExpress.Data.v24.1.dll
NuGet Package: DevExpress.Data
Declaration
Parameters
Name | Type | Description |
---|---|---|
aggregatedExpression | CriteriaOperator | A CriteriaOperator object which specifies the aggregate expression. |
Returns
Type | Description |
---|---|
AggregateOperand | An AggregateOperand object which calculates an aggregate expression. |
Example
Check whether a collection has elements that match a criteria.
Expression:
CriteriaOperator.FromLambda<Order>(o => o.OrderItems.Any(oi=>oi.ItemPrice==20)); ;
Input:
Order | OrderItemName | ItemPrice |
---|---|---|
Order0 | ||
OrderItem1 | 20 | |
OrderItem2 | 30 |
The result: True
See Also