mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 完善 ISelect<T>.WithSql 方法,支持传入参数化 #413;
This commit is contained in:
@ -256,13 +256,14 @@ namespace FreeSql.Internal.CommonProvider
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISelect<T1> WithSql(string sql)
|
||||
public ISelect<T1> WithSql(string sql, object parms = null)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables.First().Table?.Type) return $"( {sql} )";
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject(sql, parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user