I am using BeforeSelect to add a filter for tenants and when use ScanAndCount the COUNT SQL does not include the where clause for the Tenant added in BeforeSelect when the results are Paginated.
Using the source attached you can see the tenant is not applied when calling ScanAndCount. Uses zerolog because that is how we found it.
example.zip