Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

需求:WithSql希望能参数化,谢谢! #413

Closed
ycqhg opened this issue Aug 13, 2020 · 1 comment
Closed

需求:WithSql希望能参数化,谢谢! #413

ycqhg opened this issue Aug 13, 2020 · 1 comment

Comments

@ycqhg
Copy link

ycqhg commented Aug 13, 2020

在很多场景下需要针对传入的条件进行参数化查询,需要根据条件空与否来进行拼装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>

@2881099
Copy link
Collaborator

2881099 commented Aug 13, 2020

1.8.0-preview0811 十分钟后可以下载

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants