Hi,
I can use autoquery since I’m just using the servicestack orm. and not servicestack services.
The kind of query API that I’m after is to be able to chain field names, values, and comparers dynamically.
If this is to build a dynamic Service than look at AutoQuery first as it enables dynamic querying.
Otherwise you’d need to invent that Query API language itself, behind the scenes you can call the AddCondition API, e.g:
var q = db.From<T>()
.AddCondition("AND","Id < {0}", 10)
.AddCondition("AND","Fullname LIKE {0}", "A%")
.AddCondition("OR","CountryCode IN ({0})",new SqlInValues("US,GB".Split(",")));
var results = db.Select(q);
Or you can also call Where(sqlFragment), And(sqlFragment) or Or(sqlFragment) if you prefer, these APIs include common SQL verification, if you need to bypass SQL Verification for a query you can call UnsafeWhere(sqlFragment), UnsafeAnd(sqlFragment) or UnsafeOr(sqlFragment).