时间:2021-07-01 10:21:17 帮助过:12人阅读
以上的语句执行后的结果是错误的,在Dapper
中,类似SQL语句中的like
应该如何处理呢?
term = "whateverterm";
var encodeForLike = term => term.Replace("[", "[[]").Replace("%", "[%]");
string term = "%" + encodeForLike(term) + "%";
var data = conn.Query(@"
select top 25
Term as Label,
Type,
ID
from SearchTerms
WHERE Term like @term",
new { term });
string query = "SELECT * from country WHERE Name LIKE CONCAT(‘%‘,@name,‘%‘);"
var results = connection.query<country>(query, new {name});
db.Query<Remitente>("SELECT *
FROM Remitentes
WHERE Nombre LIKE @n", new { n = "%" + nombre + "%" })
.ToList();
Sqlite 参数化 模糊查询 解决方案
标签:nec 模糊 csharp rms result 描述 select tps head