AggregateOperand.Exists(CriteriaOperator) Method
In This Article
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.2.dll
NuGet Package: DevExpress.Data
#Declaration
public AggregateOperand Exists(
CriteriaOperator aggregatedExpression
)
#Parameters
Name | Type | Description |
---|---|---|
aggregated |
Criteria |
A Criteria |
#Returns
Type | Description |
---|---|
Aggregate |
An Aggregate |
#Example
Check whether a collection has elements that match a criteria.
Expression:
CriteriaOperator.FromLambda<Order>(o => o.OrderItems.Any(oi=>oi.ItemPrice==20)); ;
Test
Input:
Order | Order | Item |
---|---|---|
Order0 | ||
Order | 20 | |
Order | 30 |
The result: True
See Also