Table of Contents

Class FilterParam<TEntity>

Namespace
Tlabs.Server.Model
Assembly
Tlabs.SrvBase.dll

Filter parameter model to be bound via MVC model binding.

public class FilterParam<TEntity> : PagingParam

Type Parameters

TEntity
Inheritance
FilterParam<TEntity>
Inherited Members
Extension Methods

Remarks

This filter parameter model is aimed to bind a request like:

api/sampleTypes?start=0&limit=25&filter=[{"property":"lastname","value":"xyz"}]
NOTE:

This binds the filter to an array of Filter objects and sort to an array of Sorter objects respectively.

Constructors

FilterParam()

public FilterParam()

Properties

EnforcedFilters

Filters that are enforced

[Obsolete("This is no longer recognized - enforced access filters are applied with RoleDefaultParamsFilter ", false)]
public Dictionary<string, string>? EnforcedFilters { get; set; }

Property Value

Dictionary<string, string>

FilterList

List of Filter(s).

public IEnumerable<Filter>? FilterList { get; set; }

Property Value

IEnumerable<Filter>

SorterList

List of Sorter(s).

public IEnumerable<Sorter>? SorterList { get; set; }

Property Value

IEnumerable<Sorter>

filter

filter string with format: [{"property":"lastname","value":"aal","operator":"like"}].

public string? filter { get; set; }

Property Value

string

sort

sort string with format: [{"property":"fieldName","direction":"ASC"}].

public string? sort { get; set; }

Property Value

string

Methods

AsQueryFilter()

Return QueryFilter from this filter parameter(s).

public QueryFilter AsQueryFilter()

Returns

QueryFilter

BindAsync(HttpContext)

Support custom binding.

public static ValueTask<FilterParam<TEntity>?> BindAsync(HttpContext httpCtx)

Parameters

httpCtx HttpContext

Returns

ValueTask<FilterParam<TEntity>>