Skip to content

Commit 873364c

Browse files
2881028810
28810
authored and
28810
committed
- 修复 .From<T2>.GroupBy Item2 以上无组参数未查找到的 bug #63
1 parent 611c066 commit 873364c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

FreeSql/Internal/CommonProvider/SelectProvider/SelectGroupingProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ string getSelectGroupingMapString(Expression[] members) {
4141
if (mem0Name?.StartsWith("Item") == true && int.TryParse(mem0Name.Substring(4), out var tryitemidx)) {
4242
if (tryitemidx == 1) foridx++;
4343
else {
44-
var alias = $"SP10{(char)(96 + tryitemidx)}";
45-
var tmptb = _tables.Where(a => a.AliasInit == alias && a.Table.Type == mem0.Type).FirstOrDefault();
44+
//var alias = $"SP10{(char)(96 + tryitemidx)}";
45+
var tmptb = _tables.Where((a,idx) => //a.AliasInit == alias &&
46+
a.Table.Type == mem0.Type && idx == tryitemidx - 1).FirstOrDefault();
4647
if (tmptb != null) {
4748
tb = tmptb;
4849
foridx++;

0 commit comments

Comments
 (0)