AutoQuery QueryFilter

I have a question about applying a filter using the RegisterQueryFilter. I was wondering what I should use for the first Generic type to be able to intercept even queries done using LoadSelect or AutoQuery.Execute for specific classes?

Here are the docs for AutoQuery Extensibility with Filters, the generic params for RegisterQueryFilter is RequestDto and ModelType which will let you modify the Query before it’s executed.

I did that but when I am using LoadSelect to get it as a child property I.e. LoadSelect(q, new string[] {“Property”}) the filter is not called.

I’m unable to follow you, the QueryFilter lets you modify the Typed SqlExpression of an AutoQuery request, where is LoadSelect now being called? Are you creating a custom autoquery implementation? in which case why are you using a filter?

Ahhhhhhhh :slight_smile:

I misunderstood the usage. I understand now.


No wait spoke too soon.

When is it applied using auto query only at Execute?

Filters are applied at the end of AutoQuery.CreateQuery(query, Request), i.e. where it can modify the SqlExpression before it’s returned to your custom AutoQuery impl.

Now I get it thank you.