Class QueryFilterAttribute
Contains reference to filter function defined by HasQueryFilter(Expression<Func<TEntity, IDataContext, bool>>) or one of its keyed overloads. Multiple instances of this attribute may be applied to the same entity to declare several named filters; at query time the filters are AND-combined unless suppressed by IgnoreFilters<TSource>(IQueryable<TSource>, params Type[]) or its keyed counterparts.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = true)]
public class QueryFilterAttribute : MappingAttribute, _Attribute
- Inheritance
-
objectQueryFilterAttribute
- Implements
- Inherited Members
- Extension Methods
Properties
FilterFunc
Filter function of type Func<T1, T2, TResult>, where
- - T1 and TResult are IQueryable<T>
- - T2 is IDataContext
public Delegate? FilterFunc { get; set; }
Property Value
FilterKey
Filter identifier used to address the filter individually via the keyed HasQueryFilter(string, Expression<Func<TEntity, IDataContext, bool>>?) overloads and to selectively disable it via IgnoreFilters<TSource>(IQueryable<TSource>, IEnumerable<string>, params Type[]).
A null or empty value identifies the default (anonymous) filter slot, populated by the
non-keyed HasQueryFilter overloads.
public string? FilterKey { get; set; }
Property Value
FilterLambda
Filter LambdaExpression.
Expression<Func<TEntity, IDataContext, bool>>
<p>
For example <code>(e, db) => e.IsDeleted == false</code>
</p>
public LambdaExpression? FilterLambda { get; set; }
Property Value
Methods
GetObjectID()
Returns mapping attribute id, based on all attribute options.
public override string GetObjectID()