像这样。
db.Query(
"select id, name, salary, city from employees where city like in @listofcity",
new{
@listofcity=new List{"%s","%a%","%ya"} //this list can be dynamically generated
}
);
相当于:
select id, name, salary, city from employees
where
city like '%s'
or
city like '%a%'
or
city like '%ya'
是否可以使用dapper编写类似于上面代码的内容,其中list是动态生成的?