Class CriteriaItem<TValue>
Represents a single criteria item used for building dynamic filter expressions.
Inherited Members
Namespace: Coree.NETStandard.Classes.Criteria
Assembly: Coree.NETStandard.dll
Syntax
public class CriteriaItem<TValue>
Type Parameters
| Name | Description |
|---|---|
| TValue | The type of the value used in the criteria comparison. |
Constructors
| Edit this page View SourceCriteriaItem(string, CriteriaComparisonMethod, TValue, bool, CriteriaOperator)
Initializes a new instance of the CriteriaItem<TValue> class with specified settings for filtering.
Declaration
public CriteriaItem(string propertyName, CriteriaComparisonMethod comparisonMethod, TValue value, bool negate = false, CriteriaOperator logicalOperator = CriteriaOperator.And)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName | The property name of the object to evaluate. |
| CriteriaComparisonMethod | comparisonMethod | The method of comparison to apply. |
| TValue | value | The value to compare against the property. |
| bool | negate | True to negate the result of the comparison; otherwise, false. |
| CriteriaOperator | logicalOperator | The logical operator to use in combining this criteria with others. |
Properties
| Edit this page View SourceComparisonMethod
Gets or sets the comparison method to be used in evaluating the criteria.
Declaration
public CriteriaComparisonMethod ComparisonMethod { get; set; }
Property Value
| Type | Description |
|---|---|
| CriteriaComparisonMethod |
Negate
Gets or sets a value indicating whether the result of the criteria comparison should be negated.
Declaration
public bool Negate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Operator
Gets or sets the logical operator to use in conjunction with previous or subsequent criteria.
Declaration
public CriteriaOperator Operator { get; set; }
Property Value
| Type | Description |
|---|---|
| CriteriaOperator |
PropertyName
Gets or sets the name of the property to be evaluated by the criteria.
Declaration
public string PropertyName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Value
Gets or sets the value against which the property's value will be compared. This value can be null.
Declaration
public TValue Value { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
Operators
| Edit this page View Sourceimplicit operator CriteriaItem<object>(CriteriaItem<TValue>)
Defines an implicit conversion of a CriteriaItem<TValue> to a CriteriaItem<TValue>.
Declaration
public static implicit operator CriteriaItem<object>(CriteriaItem<TValue> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| CriteriaItem<TValue> | expression | The CriteriaItem<TValue> to convert. |
Returns
| Type | Description |
|---|---|
| CriteriaItem<object> | A new CriteriaItem<TValue> that contains the converted instance. |