一切福田,不離方寸,從心而覓,感無不通。
//参数直接写参数名 string Sql = "select * from [table] where field like @field";
//参数值里面加上通配符,varchar类型查询也不加单引号 var Param = new {field = "%{ParamValue}%"};
//执行查询 Dapper.Query<T>(Sql,Param);
from:https://www.cnblogs.com/tian2008/p/8491633.html
Copyright © 2024 Longsheng All rights reserved