Here's the help page for the ExecuteQuery
method.
You can't pass the whole where clause as a parameter because a query like select * from myTable @param
isn't valid SQL, whereas select * from myTable where myField = @param
is valid SQL.
So, in answer to your specific question - no, you can't do this by passing parameters to ExecuteQuery
.
However, why not build up the query in code before you pass it to ExecuteQuery
?
e.g.
var query = "select * from myTable where 1=1" + string.Join(" AND ", whereClauses);
var result = _db.ExecuteQuery<AccountModel>(query);