IsExactTypeFunction Class
A custom function that determines whether a particular object has a specified type.
Namespace: DevExpress.Xpo.Metadata
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
NuGet Package: DevExpress.Xpo
Declaration
Remarks
The IsExactTypeFunction custom function operator takes 2 operands:
- The first operand specifies the object whose type will be checked.
- 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.