AspNetCore.IQueryable.Extensions icon indicating copy to clipboard operation
AspNetCore.IQueryable.Extensions copied to clipboard

Define [QueryOperator] dynamically

Open drma-tech opened this issue 1 year ago • 0 comments

@brunobritodev @GedanMagal

Have you ever thought about being able to define the type of filter applied dynamically? like, the user has the filter on the grid, which has all the possible options and he chooses what he wants to use. but it is not feasible for me to create about 10 attributes for each property, because each one needs to have a different query operator. there could be one and I would inform by the query string which one I will use.

ex:

[QueryOperator(Operator = WhereOperator.Dynamic, CaseSensitive = false)]
public string? Name { get; set; }

then, the call https://localhost:7139/api/Supplier?Limit=10&Offset=0&Name=Paul|Contains

drma-tech avatar Mar 13 '23 13:03 drma-tech