DbExtensions 的新手(就在今天早上),现在我有一个看起来像这样的 SQL 语句
SELECT * FROM myTable
WHERE (Field1 LIKE @Word)
OR (Field2 LIKE @Word)
OR (Field3 LIKE @Word)
OR (Field4 LIKE @Word)
OR (Field5 LIKE @Word)
我不知道如何使用 DbExtensions 做到这一点?
这就是我到目前为止所拥有的
var query = SQL
.FROM("myTable")
.WHERE();
query.AppendClause("OR", ",", "Field1 LIKE {0}", new string[] { term });
query.AppendClause("OR", ",", "Field2 LIKE {0}", new string[] { term });
query.AppendClause("OR", ",", "Field3 LIKE {0}", new string[] { term });
query.AppendClause("OR", ",", "Field4 LIKE {0}", new string[] { term });
query.AppendClause("OR", ",", "Field5 LIKE {0}", new string[] { term });
但这不会添加很多参数,这些参数只有 1 个值。也许我错过了什么?