Table of Contents

Class EnumerableFilter<TFilter>

Namespace
Magicalizer.Filters.Abstractions
Assembly
Magicalizer.Filters.Abstractions.dll

Filter of collection properties: by emptiness and by filters that any or none of the elements match. Only the conditions that are set are applied.

public class EnumerableFilter<TFilter> : IEnumerableFilter, IFilter where TFilter : IFilter

Type Parameters

TFilter

Element filter type.

Inheritance
EnumerableFilter<TFilter>
Implements
Inherited Members

Constructors

EnumerableFilter()

Creates an empty filter.

public EnumerableFilter()

EnumerableFilter(bool?, IEnumerable<TFilter>?, IEnumerable<TFilter>?)

Creates a filter with the given conditions.

public EnumerableFilter(bool? isEmpty = null, IEnumerable<TFilter>? any = null, IEnumerable<TFilter>? none = null)

Parameters

isEmpty bool?

Matches empty collections if true, non-empty ones if false.

any IEnumerable<TFilter>

Matches collections with at least one element matching each of these filters.

none IEnumerable<TFilter>

Matches collections without elements matching any of these filters.

Properties

Any

Matches collections with at least one element matching each of these filters.

public IEnumerable<TFilter>? Any { get; set; }

Property Value

IEnumerable<TFilter>

IsEmpty

Matches empty collections if true, non-empty ones if false.

public bool? IsEmpty { get; set; }

Property Value

bool?

None

Matches collections without elements matching any of these filters.

public IEnumerable<TFilter>? None { get; set; }

Property Value

IEnumerable<TFilter>