Skip to main content
A newer version of this page is available. .

IsExactTypeFunction Class

A custom function that determines whether a particular object has a specified type.

Namespace: DevExpress.Xpo.Metadata

Assembly: DevExpress.Xpo.v21.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public class IsExactTypeFunction :
    ICustomFunctionOperatorBrowsable,
    ICustomFunctionOperator,
    ICustomFunctionDisplayAttributes,
    ICustomFunctionOperatorConvertibleToExpression,
    ICustomFunctionOperatorCompileable

Remarks

The IsExactTypeFunction custom function operator takes 2 operands:

  1. The first operand specifies the object whose type will be checked.
  2. The second operand specifies the fully qualified name of the required type.

Assume you have a collection of Employee objects. Employees can either be objects of the LocalEmployee or ForeignEmployee types:

public class LocalEmployee : Employee { /* ... */ }

public class ForeignEmployee : Employee { /* ... */ }

The following code snippet demonstrates how the employees collection can be filtered to contain only foreign employees.

using DevExpress.Xpo;
using DevExpress.Data.Filtering;
//...
XPCollection<EmployeeBase> employees = new XPCollection<EmployeeBase>(Session);
employees.Criteria = CriteriaOperator.Parse("IsExactType(This, ?)", typeof(ForeignEmployee).FullName);

The IsExactTypeFunction function is automatically registered in XPO applications.

Inheritance

Object
IsExactTypeFunction
See Also