Raajkumar
Raajkumar

Reputation: 897

ServiceStack AutoQuery AutoFilter Like operand

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.

Upvotes: 2

Views: 84

Answers (1)

mythz
mythz

Reputation: 143359

You should use [QueryDbField] for Customizable Adhoc Queries.

Upvotes: 2

Related Questions