A Sandcastle Documented Class Library

# QueryFilterOperator Enumeration

Operators which can be used in engine query methods.

Namespace: Dundas.BI
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    public enum QueryFilterOperator

    Public Enumeration QueryFilterOperator

    public enum class QueryFilterOperator

    type QueryFilterOperator

Members

| Member name | Value | Description
--- | --- | --- | ---
| Equals | 0 | The equals operator. The value must be the same type as the field.
| LessThan | 1 | The less than operator. This operator is only valid for numeric or date/time fields.
| LessThanOrEqualTo | 2 | The less than or equal to operator. This operator is only valid for numeric or date/time fields.
| GreaterThan | 3 | The greater than operator. This operator is only valid for numeric or date/time fields.
| GreaterThanOrEqualTo | 4 | The greater than or equal to operator. This operator is only valid for numeric or date/time fields.
| Contains | 5 | The contains operator. This operator is only valid for string fields.
| In | 6 | The IN operator. If this operator is chosen, the provided value must be an object which implements IEnumerable, and whose elements are the same type as the field.
| StartsWith | 7 | The starts with operator. This operator is only valid for string fields.
| EndsWith | 8 | The ends with operator. This operator is only valid for string fields.
| Matches | 9 | Wildcard matching operator. This operator is only valid for string fields.
| And | 10 | The AND operator.
| Or | 11 | The OR operator.
| Exists | 12 | The EXISTS operator.

Remarks
Instructions for using the And and Or operators:

- The corresponding query field is ignored, and must be set to the None value of the relevant enumeration (e.g. AccountQueryField.None).
- The corresponding filter value must be an object which implements IEnumerable, whose elements are instances of additional query filter rules.

Examples
The following example demonstrates usage of the Or operator. We are going to query for accounts which are enabled, and where either the account name OR the display name contains the substring "smith".
C#
Copy

    IAccountService acctSvc = Engine.Current.GetService<IAccountService>();

    string substring = "smith";

    var filter = new[]
    {
        new AccountQueryFilterRule(AccountQueryField.IsEnabled, QueryFilterOperator.Equals, true),
        new AccountQueryFilterRule(AccountQueryField.None, QueryFilterOperator.Or, new[]
        {
            new AccountQueryFilterRule(AccountQueryField.Name, QueryFilterOperator.Contains, substring),
            new AccountQueryFilterRule(AccountQueryField.DisplayName, QueryFilterOperator.Contains, substring),
        }),
    };

    IList<Account> results = acctSvc.AccountQuery(0, 0, null, filter);

See Also

#### Reference

Dundas.BI Namespace
IAccountService
AccountQuery(Int32, Int32, IList
Tuple
AccountQueryField, SortDirection
, ICollection
AccountQueryFilterRule
)
IGroupService
GroupQuery(Int32, Int32, IList
Tuple
GroupQueryField, SortDirection
, ICollection
GroupQueryFilterRule
)
ISessionService
SessionQuery(Int32, Int32, IList
Tuple
SessionQueryField, SortDirection
, ICollection
SessionQueryFilterRule
)
IMultiTenancyService
TenantQuery(Int32, Int32, IList
Tuple
TenantQueryField, SortDirection
, ICollection
TenantQueryFilterRule
)
IFileSystemService
FileSystemQuery(Int32, Int32, Guid, FileSystemQueryOptions, IList
Tuple
FileSystemQueryField, SortDirection
, ICollection
FileSystemQueryFilterRule
)
IFileSystemService
RevisionQuery(Int32, Int32, Guid, FileSystemQueryOptions, IList
Tuple
RevisionQueryField, SortDirection
, ICollection
RevisionQueryFilterRule
)
ILoggingService
LogEntryQuery(Int32, Int32, IList
Tuple
LogEntryQueryField, SortDirection
, ICollection
LogEntryQueryFilterRule
)
IScheduleService
ScheduleQuery(Int32, Int32, IList
Tuple
ScheduleQueryField, SortDirection
, ICollection
ScheduleQueryFilterRule
)