Closed
Description
在很多场景下需要针对传入的条件进行参数化查询,需要根据条件空与否来进行拼装Parameter,比如:
var where = "";
if(name != "" && age > 0)
{
where ="where Name=@name and Age=@Age";
}
var sql = $“select * from tb {where}”;
希望能重载WithSql增加一个参数:
ISelect ISelect.WithSql(string sql, [object parms = null]);
示例:
WithSql("select * from tb where Name=@name and Age=@Age", new {Name="aaa", Age=22});
并且parms参数还可以传Dictionary<string, object>
Metadata
Metadata
Assignees
Labels
No labels