Table of Contents

Class QueryFilterAttribute

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll

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
object
QueryFilterAttribute
Implements
Inherited Members
Extension Methods

Properties

FilterFunc

Filter function of type Func<T1, T2, TResult>, where

public Delegate? FilterFunc { get; set; }

Property Value

Delegate

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

string

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

LambdaExpression

Methods

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string