Conventions for NOT

AutoQuery have all these built-in conventions for querying: AutoQuery RDBMS

However it seems to lack a few “not” conventions. Such as DoesNotContain or DoesNotStartWith.

Is this a good way to add more:

// Configure.AutoQuery.cs
var autoQueryFeature = new AutoQueryFeature { ... }

autoQueryFeature.EndsWithConventions.Add("DoesNotContain", new QueryDbFieldAttribute
{
      Template = "UPPER({Field}) NOT LIKE UPPER({Value})",
      ValueFormat = "%{0}%"
});

appHost.Plugins.Add(autoQueryFeature);

Yeah that should work.

1 Like