You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在很多场景下需要针对传入的条件进行参数化查询,需要根据条件空与否来进行拼装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>
The text was updated successfully, but these errors were encountered:
在很多场景下需要针对传入的条件进行参数化查询,需要根据条件空与否来进行拼装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>
The text was updated successfully, but these errors were encountered: