From d41722f449c1f5ee7e63d12544bf82e29d45db51 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 23 Jan 2018 11:02:27 +0800 Subject: [PATCH] Update Bug --- Src/Asp.Net/SqlServerTest/Demos/Z_DemoBase.cs | 3 +-- .../ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Src/Asp.Net/SqlServerTest/Demos/Z_DemoBase.cs b/Src/Asp.Net/SqlServerTest/Demos/Z_DemoBase.cs index 46e139686..58f400db5 100644 --- a/Src/Asp.Net/SqlServerTest/Demos/Z_DemoBase.cs +++ b/Src/Asp.Net/SqlServerTest/Demos/Z_DemoBase.cs @@ -11,8 +11,7 @@ namespace OrmTest.Demo public static SqlSugarClient GetInstance() { SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); - db.Ado.IsEnableLogEvent = true; - db.Ado.LogEventStarting = (sql, pars) => + db.Aop.OnLogExecuting = (sql, pars) => { Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value))); Console.WriteLine(); diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs index 1696abd80..5caa0bbac 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs @@ -359,7 +359,7 @@ namespace SqlSugar isHasValue = isLogicOperator && memberName == "HasValue" && expression.Expression != null && expression.NodeType == ExpressionType.MemberAccess; isDateDate = memberName == "Date" && expression.Expression.Type == UtilConstants.DateType; isMemberValue = expression.Expression != null && expression.Expression.NodeType != ExpressionType.Parameter && !isValueBool; - isSingle = parameter.Context.ResolveType == ResolveExpressType.WhereSingle; + isSingle = parameter.Context.ResolveType.IsIn(ResolveExpressType.WhereSingle, ResolveExpressType.SelectSingle, ResolveExpressType.FieldSingle, ResolveExpressType.ArraySingle); fieldIsBool = isBool && isLogicOperator && (parameter.BaseParameter == null || !(parameter.BaseParameter.CurrentExpression is MemberInitExpression || parameter.BaseParameter.CurrentExpression is NewExpression)); var isSelect = this.Context.ResolveType.IsIn(ResolveExpressType.SelectSingle, ResolveExpressType.SelectMultiple); isSelectField = isSelect && isRoot;