Class EnumFilter<TEnum>
- Namespace
- Magicalizer.Filters.Abstractions
- Assembly
- Magicalizer.Filters.Abstractions.dll
Filter of enum properties. The values are passed by their names or numbers (e.g. "diet.equals=vegan"). Only the conditions that are set are applied.
public class EnumFilter<TEnum> : EquatableFilterBase<TEnum>, IFilter where TEnum : struct, Enum
Type Parameters
TEnumEnum type.
- Inheritance
-
ValueFilterBase<TEnum>EquatableFilterBase<TEnum>EnumFilter<TEnum>
- Implements
- Inherited Members
Constructors
EnumFilter()
Creates an empty filter.
public EnumFilter()
EnumFilter(bool?, TEnum?, TEnum?, IEnumerable<TEnum>?, IEnumerable<TEnum>?)
Creates a filter with the given conditions.
public EnumFilter(bool? isNull = null, TEnum? equals = null, TEnum? notEquals = null, IEnumerable<TEnum>? @in = null, IEnumerable<TEnum>? notIn = null)
Parameters
isNullbool?Matches null values if
true, non-null ones iffalse.equalsTEnum?Matches values equal to this one.
notEqualsTEnum?Matches values not equal to this one.
inIEnumerable<TEnum>Matches values equal to any of these (the query parameter is repeated, e.g. "id.in=1&id.in=2").
notInIEnumerable<TEnum>Matches values not equal to any of these (the query parameter is repeated, e.g. "id.notin=1&id.notin=2").