mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 增加 "x1".First/FirstOrDefault 表达式函数解析;
This commit is contained in:
		@@ -105,6 +105,16 @@ namespace FreeSql.SqlServer
 | 
			
		||||
                        objExp = callExp.Arguments.FirstOrDefault();
 | 
			
		||||
                        objType = objExp?.Type;
 | 
			
		||||
                        argIndex++;
 | 
			
		||||
 | 
			
		||||
                        if (objType == typeof(string))
 | 
			
		||||
                        {
 | 
			
		||||
                            switch (callExp.Method.Name)
 | 
			
		||||
                            {
 | 
			
		||||
                                case "First":
 | 
			
		||||
                                case "FirstOrDefault":
 | 
			
		||||
                                    return $"substring({getExp(callExp.Arguments[0])}, 1, 1)";
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    if (objType == null) objType = callExp.Method.DeclaringType;
 | 
			
		||||
                    if (objType != null || objType.IsArrayOrList())
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user