ServiceStack AutoQuery AutoFilter Like operand

68 Views Asked by At

I am trying to implement SQL Like operator using AutoFilter attribute. Tried the below code,

[AutoFilter(field:"Name", Template = "{Field} like {Value}",  ValueFormat = "%{0}%")]

and the transformed SQL Expression looks like this (from SQL Profiler),

WHERE ("Table"."Name" = @0) AND ("Table"."Name" = @1)',N'@0 nvarchar(4000),@1 varchar(8000)',@0=NULL,@1='denver'

What am I doing wrong? I tried QueryTerm.And,QueryTerm.Or and QueryTerm.Default as well.

1

There are 1 best solutions below

0
mythz On BEST ANSWER

You should use [QueryDbField] for Customizable Adhoc Queries.