Enums

The DynamicWhere.ex library includes the following enums to support dynamic querying capabilities

DataType

The DataType enum provides support for various data types when defining conditions in dynamic queries. It includes the following values:

  • Guid: Represents globally unique identifier (GUID) data.

  • Text: Represents textual data.

  • Number: Represents numeric data.

  • Boolean: Represents boolean data.

  • Date: Represents date-only data without the time component.

  • DateTime: Represents date and time data.

You can use the DataType enum to specify the data type for your dynamic query conditions, making it easier to work with different types of data.


Operator

The Operator enum offers a comprehensive set of logical comparison operators for constructing dynamic queries. It now includes both case-sensitive and case-insensitive versions of certain operators, allowing for greater flexibility in query construction. The operators are:

  • Equal: Equality comparison.

  • IEqual: Case-insensitive equality comparison.

  • NotEqual: Inequality comparison.

  • INotEqual: Case-insensitive inequality comparison.

  • GreaterThan: Greater than comparison.

  • GreaterThanOrEqual: Greater than or equal to comparison.

  • LessThan: Less than comparison.

  • LessThanOrEqual: Less than or equal to comparison.

  • Contains: Substring containment check.

  • IContains: Case-insensitive substring containment check.

  • NotContains: Negation of substring containment check.

  • INotContains: Negation of case-insensitive substring containment check.

  • StartsWith: Prefix check.

  • IStartsWith: Case-insensitive prefix check.

  • NotStartsWith: Negation of prefix check.

  • INotStartsWith: Negation of case-insensitive prefix check.

  • EndsWith: Suffix check.

  • IEndsWith: Case-insensitive suffix check.

  • NotEndsWith: Negation of suffix check.

  • INotEndsWith: Negation of case-insensitive suffix check.

  • In: Membership check.

  • IIn: Case-insensitive membership check.

  • NotIn: Negation of membership check.

  • INotIn: Negation of case-insensitive membership check.

  • Between: Range comparison.

  • NotBetween: Negation of range comparison.

  • IsNull: Null check.

  • IsNotNull: Negation of null check.

These operators can be used in combination with the library's extension methods to create complex dynamic queries with both case-sensitive and case-insensitive comparisons, providing greater flexibility in query construction.


Connector

The Connector enum provides logical connectors that allow you to combine conditions within a query. It includes the following connectors:

  • And: Represents the logical "AND" connector.

  • Or: Represents the logical "OR" connector.

You can use these connectors to specify how conditions should be combined in your dynamic queries, enabling flexible query construction.


Intersection

The Intersection enum is used to define how multiple sets of conditions should be combined in a query. It includes the following intersection types:

  • Union: Represents the union of sets, combining conditions with "OR" logic.

  • Intersect: Represents the intersection of sets, combining conditions with "AND" logic.

  • Except: Represents the difference between sets, excluding conditions that meet specified criteria.

These intersection types are valuable when you need to apply logical operations to multiple sets of conditions in your dynamic queries.


Direction

The Direction enum is used to specify the sorting direction in queries. It includes the following sorting directions:

  • Ascending: Represents ascending sorting direction.

  • Descending: Represents descending sorting direction.

You can use the Direction enum when defining sorting preferences for your queries to control whether the results should be sorted in ascending or descending order.

Last updated