Table of Contents

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

TEnum

Enum type.

Inheritance
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

isNull bool?

Matches null values if true, non-null ones if false.

equals TEnum?

Matches values equal to this one.

notEquals TEnum?

Matches values not equal to this one.

in IEnumerable<TEnum>

Matches values equal to any of these (the query parameter is repeated, e.g. "id.in=1&id.in=2").

notIn IEnumerable<TEnum>

Matches values not equal to any of these (the query parameter is repeated, e.g. "id.notin=1&id.notin=2").