mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 修复 子查询 Count/Max/Min/Avg/Sum 使用了 Limit(1) 的 bug;#462
This commit is contained in:
		@@ -921,7 +921,13 @@ namespace FreeSql.Internal
 | 
			
		||||
                                        fsqlType = fsql?.GetType();
 | 
			
		||||
                                        if (fsqlType == null) break;
 | 
			
		||||
                                        var fsqlSelect0 = fsql as Select0Provider;
 | 
			
		||||
                                        if (exp3.Method.Name != "ToList") fsqlSelect0._limit = 1;
 | 
			
		||||
                                        switch (exp3.Method.Name) {
 | 
			
		||||
                                            case "Any": //exists
 | 
			
		||||
                                            case "ToOne":
 | 
			
		||||
                                            case "First":
 | 
			
		||||
                                                fsqlSelect0._limit = 1; //#462
 | 
			
		||||
                                                break;
 | 
			
		||||
                                        }
 | 
			
		||||
                                        if (tsc.dbParams != null) fsqlSelect0._params = tsc.dbParams;
 | 
			
		||||
                                        fsqltables = fsqlSelect0._tables;
 | 
			
		||||
                                        //fsqltables[0].Alias = $"{tsc._tables[0].Alias}_{fsqltables[0].Alias}";
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user