From 59df2738181453229bb51897e136eb3656589afb Mon Sep 17 00:00:00 2001 From: "610262374@qq.com" <610262374@qq.com> Date: Mon, 26 Nov 2018 14:11:12 +0800 Subject: [PATCH] Join ExtSqlFunc bug --- .../SqlSugar/Infrastructure/SqlSugarAccessory.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs index cbc93ef7e..931db407b 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs @@ -247,14 +247,14 @@ namespace SqlSugar #endregion #region Create Instance - protected ISugarQueryable CreateQueryable() + protected ISugarQueryable CreateQueryable() { ISugarQueryable result = InstanceFactory.GetQueryable(this.CurrentConnectionConfig); return CreateQueryable(result); } - protected ISugarQueryable CreateQueryable(ISugarQueryable result) + protected ISugarQueryable CreateQueryable(ISugarQueryable result) { - Check.Exception(typeof(T).IsClass()==false|| typeof(T).GetConstructors().Length==0, "Queryable<{0}> Error ,{0} is invalid , need is a class,and can new().", typeof(T).Name); + Check.Exception(typeof(T).IsClass() == false || typeof(T).GetConstructors().Length == 0, "Queryable<{0}> Error ,{0} is invalid , need is a class,and can new().", typeof(T).Name); var sqlBuilder = InstanceFactory.GetSqlbuilder(CurrentConnectionConfig); result.Context = this.Context; result.SqlBuilder = sqlBuilder; @@ -309,7 +309,7 @@ namespace SqlSugar return result; } - protected void CreateQueryJoin(Expression joinExpression, Type[] types, ISugarQueryable queryable) + protected void CreateQueryJoin(Expression joinExpression, Type[] types, ISugarQueryable queryable) { this.CreateQueryable(queryable); string shortName = string.Empty; @@ -322,13 +322,13 @@ namespace SqlSugar queryable.SqlBuilder.QueryBuilder.Parameters.AddRange(paramters); } } - protected void CreateEasyQueryJoin(Expression joinExpression, Type[] types, ISugarQueryable queryable) + protected void CreateEasyQueryJoin(Expression joinExpression, Type[] types, ISugarQueryable queryable) { this.CreateQueryable(queryable); string shortName = string.Empty; queryable.SqlBuilder.QueryBuilder.EasyJoinInfos = this.GetEasyJoinInfo(joinExpression, ref shortName, queryable.SqlBuilder, types); queryable.SqlBuilder.QueryBuilder.TableShortName = shortName; - queryable.SqlBuilder.QueryBuilder.JoinExpression=joinExpression; + queryable.SqlBuilder.QueryBuilder.JoinExpression = joinExpression; } #endregion @@ -340,6 +340,8 @@ namespace SqlSugar ILambdaExpressions expressionContext = sqlBuilder.QueryBuilder.LambdaExpressions; expressionContext.MappingColumns = this.Context.MappingColumns; expressionContext.MappingTables = this.Context.MappingTables; + if (this.Context.CurrentConnectionConfig.ConfigureExternalServices != null) + expressionContext.SqlFuncServices = this.Context.CurrentConnectionConfig.ConfigureExternalServices.SqlFuncServices; expressionContext.Resolve(joinExpression, ResolveExpressType.Join); int i = 0; var joinArray = MergeJoinArray(expressionContext.Result.GetResultArray());