23.248. Class ExpressionsBuilders
Namespace: ArmoniK.Core.Common.Utils
Assembly: ArmoniK.Core.Common.dll
Provides utility methods for building LINQ expressions to filter data models based on field values.
public static class ExpressionsBuilders
23.248.1. Inheritance
23.248.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
23.248.3. Methods
23.248.3.1. FieldFilterExpression<TData, TField>(Expression<Func<TData, TField>>, IList<TField>, bool)
Builds a filter expression for a field based on a list of values.
public static Expression<Func<TData, bool>> FieldFilterExpression<TData, TField>(Expression<Func<TData, TField>> expression, IList<TField> values, bool include = true)
23.248.3.1.1. Parameters
expression Expression<Func<TData, TField>>
An expression representing the field to filter.
values IList<TField>
The list of values to filter by.
include bool
If true, filter represented by expression is a whitelist; otherwise, it is a
blacklist.
23.248.3.1.2. Returns
Expression<Func<TData, bool>>
An expression that can be used to filter the data.
23.248.3.1.3. Type Parameters
TData
The type of the data model.
TField
The type of the field to filter.
23.248.3.2. FieldFilterInternal<TData, TField>(Expression<Func<TData, TField>>, IList<TField>, bool, Expression)
Builds an internal filter expression for a field based on a list of values.
public static Expression FieldFilterInternal<TData, TField>(Expression<Func<TData, TField>> expression, IList<TField> values, bool include, Expression x)
23.248.3.2.1. Parameters
expression Expression<Func<TData, TField>>
An expression representing the field to filter.
values IList<TField>
The list of values to filter by.
include bool
If true, filter represented by expression is a whitelist; otherwise, it is a
blacklist.
The parameter expression representing the data model.
23.248.3.2.2. Returns
An expression that can be used to filter the data.
23.248.3.2.3. Type Parameters
TData
The type of the data model.
TField
The type of the field to filter.
23.248.3.3. FieldFilterInternal<TData, TField>(Expression<Func<TData, IEnumerable<TField>>>, IList<TField>, bool, Expression)
Builds an internal filter expression for a collection field based on a list of values.
public static Expression FieldFilterInternal<TData, TField>(Expression<Func<TData, IEnumerable<TField>>> expression, IList<TField> values, bool include, Expression x)
23.248.3.3.1. Parameters
expression Expression<Func<TData, IEnumerable<TField>>>
An expression representing the collection field to filter.
values IList<TField>
The list of values to filter by.
include bool
If true, filter represented by expression is a whitelist; otherwise, it is a
blacklist.
The parameter expression representing the data model.
23.248.3.3.2. Returns
An expression that can be used to filter the data.
23.248.3.3.3. Type Parameters
TData
The type of the data model.
TField
The type of the elements in the collection field to filter.