Skip to content

How to add mongoFilter inside middleware? #6363

Closed Answered by Buk7op
Buk7op asked this question in Q&A
Discussion options

You must be logged in to vote

And another modified implementation that allows you to add filters without using IFindFluent.

public class CallLogQuery
{
    private readonly IRequestsAccessor _db;

    public CallLogQuery(IRequestsAccessor db)
    {
        _db = db;
    }

    // default
    [Authorize(Policy = Constants.ADMINS_ONLY_POLICY)]
    [UsePaging(order:Constants.GRAPHQL_ATTRIBUTES_ORDER_PAGING)]
    [UseProjection(order: Constants.GRAPHQL_ATTRIBUTES_ORDER_PROJECTION)]
    [UseSorting(order: Constants.GRAPHQL_ATTRIBUTES_ORDER_SORTING)]
    [UseFiltering(order: Constants.GRAPHQL_ATTRIBUTES_ORDER_FILTERING)]

    // our middlewares
    [UseDateTimeFilter(order: 2)]
    [UseTenantIdx(order:3)]

    public IExecu…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Buk7op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant