mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 修复 UseGenerateCommandParameterWithLambda(true) 时子语句的参数没整合到主语句;#231
- 增加 ISelect.RawJoin 方法以便实现 Outer Apply 查询;#200
This commit is contained in:
@ -808,6 +808,8 @@ namespace FreeSql.Internal
|
||||
if (fsqlType == null) break;
|
||||
if (exp3.Method.Name != "ToList")
|
||||
fsqlType.GetField("_limit", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fsql, 1);
|
||||
if (tsc.dbParams != null)
|
||||
fsqlType.GetField("_params", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fsql, tsc.dbParams);
|
||||
fsqltables = fsqlType.GetField("_tables", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fsql) as List<SelectTableInfo>;
|
||||
//fsqltables[0].Alias = $"{tsc._tables[0].Alias}_{fsqltables[0].Alias}";
|
||||
if (fsqltables != tsc._tables)
|
||||
|
@ -244,6 +244,19 @@ namespace FreeSql.Internal.CommonProvider
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject(sql, parms));
|
||||
return this as TSelect;
|
||||
}
|
||||
public TSelect RightJoin(string sql, object parms = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sql)) return this as TSelect;
|
||||
_join.Append(" \r\nRIGHT JOIN ").Append(sql);
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject(sql, parms));
|
||||
return this as TSelect;
|
||||
}
|
||||
public TSelect RawJoin(string sql)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sql)) return this as TSelect;
|
||||
_join.Append(" \r\n").Append(sql);
|
||||
return this as TSelect;
|
||||
}
|
||||
|
||||
public TSelect Limit(int limit)
|
||||
{
|
||||
@ -273,14 +286,6 @@ namespace FreeSql.Internal.CommonProvider
|
||||
return this.Limit(pageSize) as TSelect;
|
||||
}
|
||||
|
||||
public TSelect RightJoin(string sql, object parms = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sql)) return this as TSelect;
|
||||
_join.Append(" \r\nRIGHT JOIN ").Append(sql);
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject(sql, parms));
|
||||
return this as TSelect;
|
||||
}
|
||||
|
||||
public TSelect Skip(int offset)
|
||||
{
|
||||
_skip = offset;
|
||||
|
Reference in New Issue
Block a user