ICustomCriteriaOperatorQueryable.GetCriteria(CriteriaOperator[]) Method
In This Article
When implemented by a class, returns a CriteriaOperator equivalent to a custom function used in LINQ to XPO expressions, based on specified function parameters.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.2.dll
NuGet Package: DevExpress.Xpo
#Declaration
CriteriaOperator GetCriteria(
params CriteriaOperator[] operands
)
#Parameters
Name | Type | Description |
---|---|---|
operands | Criteria |
An array of Criteria |
#Returns
Type | Description |
---|---|
Criteria |
A Criteria |
#Remarks
The code below shows a sample GetCriteria implementation processing the operands.
public class MyConcatFunction : ICustomFunctionOperatorBrowsable, ICustomFunctionOperatorFormattable,
ICustomCriteriaOperatorQueryable {
const string FunctionName = "MyConcat";
// ...
public CriteriaOperator GetCriteria(params CriteriaOperator[] operands) {
if(operands == null || operands.Length != 1 || !(operands[0] is MemberInitOperator))
throw new ArgumentException(FunctionName);
CriteriaOperatorCollection operandCollection = new CriteriaOperatorCollection();
foreach(XPMemberAssignment operand in ((MemberInitOperator)operands[0]).Members) {
operandCollection.Add(operand.Property);
}
return new FunctionOperator(FunctionName, operandCollection);
}
}
To see the entire example, see the How to: Implement Custom Functions and Criteria in LINQ to XPO.
See Also