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
TFilterElement 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
isEmptybool?Matches empty collections if
true, non-empty ones iffalse.anyIEnumerable<TFilter>Matches collections with at least one element matching each of these filters.
noneIEnumerable<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>