Skip to main content

FieldFilterCriteria

Namespace: Meshmakers.Octo.Runtime.Contracts.Repositories.Query

Represents a collection of field filters for a query.

public record FieldFilterCriteria : IEquatable<FieldFilterCriteria>

Inheritance ObjectFieldFilterCriteria
Implements IEquatable<FieldFilterCriteria>

Properties

Operator

Gets the logical operator for combining field filters

public LogicalOperator Operator { get; }

Property Value

LogicalOperator

FieldFilters

Represents field filters for specific attributes with different comparison operators.

public ICollection<FieldFilter> FieldFilters { get; private set; }

Property Value

ICollection<FieldFilter>

NestedFilters

Gets the list of nested filters for complex logical operations

public List<FieldFilterCriteria> NestedFilters { get; private set; }

Property Value

List<FieldFilterCriteria>

Methods

AddFieldFilter(String, FieldFilterOperator, Object)

Adds a field filter to the query.

public void AddFieldFilter(string attributePath, FieldFilterOperator comparisonOperator, object comparisonValue)

Parameters

attributePath String
Path of attribute

comparisonOperator FieldFilterOperator
Operator of attribute

comparisonValue Object
Comparison value of the field filter

AddFieldFilter(String, FieldFilterOperator, Object, Object)

Adds a field filter to the query with a secondary value.

public void AddFieldFilter(string attributePath, FieldFilterOperator comparisonOperator, object comparisonValue, object secondaryValue)

Parameters

attributePath String
Path of attribute

comparisonOperator FieldFilterOperator
Operator of attribute

comparisonValue Object
Primary comparison value of the field filter

secondaryValue Object
Secondary comparison value (used for operators like Between)

AddNestedFilter(FieldFilterCriteria)

Adds a nested filter to the entity filter

public void AddNestedFilter(FieldFilterCriteria nestedFilter)

Parameters

nestedFilter FieldFilterCriteria
The nested filter to add

Create()

Creates a new instance of FieldFilterCriteria using the default logical operator (And).

public static FieldFilterCriteria Create()

Returns

FieldFilterCriteria
New instance of FieldFilterCriteria

Create(LogicalOperator)

Creates a new instance of FieldFilterCriteria.

public static FieldFilterCriteria Create(LogicalOperator logicalOperator)

Parameters

logicalOperator LogicalOperator
The logical operator to use for combining field filters

Returns

FieldFilterCriteria
New instance of FieldFilterCriteria

Field(String, FieldFilterOperator, Object)

Adds a field filter that checks if the value of an attribute matches the given operator and comparison value.

public FieldFilterCriteria Field(string attributePath, FieldFilterOperator fieldFilterOperator, object comparisonValue)

Parameters

attributePath String
Path of attribute

fieldFilterOperator FieldFilterOperator
Operator of attribute

comparisonValue Object
Comparison value of the field filter

Returns

FieldFilterCriteria

Fields(ICollection<FieldFilter>)

Adds a collection of field filters to the criteria.

public FieldFilterCriteria Fields(ICollection<FieldFilter> fieldFilters)

Parameters

fieldFilters ICollection<FieldFilter>
Collection of field filters to add

Returns

FieldFilterCriteria

Exceptions

ArgumentException
Thrown when the collection is null or empty.

FieldContains(String, String)

Adds a field filter that checks if the value of an attribute contains the given substring.

public FieldFilterCriteria FieldContains(string attributePath, string comparisonValue)

Parameters

attributePath String
Path of attribute

comparisonValue String
Substring to search for

Returns

FieldFilterCriteria

FieldStartsWith(String, String)

Adds a field filter that checks if the value of an attribute starts with the given prefix.

public FieldFilterCriteria FieldStartsWith(string attributePath, string comparisonValue)

Parameters

attributePath String
Path of attribute

comparisonValue String
Prefix to search for

Returns

FieldFilterCriteria

FieldEndsWith(String, String)

Adds a field filter that checks if the value of an attribute ends with the given suffix.

public FieldFilterCriteria FieldEndsWith(string attributePath, string comparisonValue)

Parameters

attributePath String
Path of attribute

comparisonValue String
Suffix to search for

Returns

FieldFilterCriteria

FieldGreaterThanOrEqual(String, Object)

Adds a field filter that checks if the value of an attribute is greater than or equal to the given value.

public FieldFilterCriteria FieldGreaterThanOrEqual(string attributePath, object comparisonValue)

Parameters

attributePath String
Path of attribute

comparisonValue Object
Comparison value of the field filter

Returns

FieldFilterCriteria

FieldLessThanOrEqual(String, Object)

Adds a field filter that checks if the value of an attribute is less than or equal to the given value.

public FieldFilterCriteria FieldLessThanOrEqual(string attributePath, object comparisonValue)

Parameters

attributePath String
Path of attribute

comparisonValue Object
Comparison value of the field filter

Returns

FieldFilterCriteria

FieldBetween(String, Object, Object)

Adds a field filter that checks if the value of an attribute is between two values (inclusive).

public FieldFilterCriteria FieldBetween(string attributePath, object lowerValue, object upperValue)

Parameters

attributePath String
Path of attribute

lowerValue Object
Lower bound value

upperValue Object
Upper bound value

Returns

FieldFilterCriteria

FieldIsNull(String)

Adds a field filter that checks if the value of an attribute is null.

public FieldFilterCriteria FieldIsNull(string attributePath)

Parameters

attributePath String
Path of attribute

Returns

FieldFilterCriteria

FieldIsNotNull(String)

Adds a field filter that checks if the value of an attribute is not null.

public FieldFilterCriteria FieldIsNotNull(string attributePath)

Parameters

attributePath String
Path of attribute

Returns

FieldFilterCriteria

FieldRegex(String, String)

Adds a field filter that checks if the value of an attribute matches the given regular expression.

public FieldFilterCriteria FieldRegex(string attributePath, string pattern)

Parameters

attributePath String
Path of attribute

pattern String
Regular expression pattern

Returns

FieldFilterCriteria