Skip to content

Commit a7ddaff

Browse files
committed
- 优化 UnionAll 为 null 的 query;
1 parent 4d0b583 commit a7ddaff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

FreeSql/Internal/CommonProvider/SelectProvider/Select1Provider.cs

+2
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ public ISelect<T1, T2, T3, T4, T5> FromQuery<T2, T3, T4, T5>(ISelect<T2> select2
213213

214214
public ISelect<T1> UnionAll(params ISelect<T1>[] querys)
215215
{
216+
querys = querys?.Where(q => q != null).ToArray();
217+
if (querys?.Any() != true) return this;
216218
var ret = (_orm as BaseDbProvider).CreateSelectProvider<T1>(null) as Select1Provider<T1>;
217219
var sb = new StringBuilder().Append(LocalGetQuerySql(this));
218220
foreach (var select2 in querys)

0 commit comments

Comments
 (0)