diff --git a/SqlServerTest/Demos/Query.cs b/SqlServerTest/Demos/Query.cs index d21283e62..ae28ed3e4 100644 --- a/SqlServerTest/Demos/Query.cs +++ b/SqlServerTest/Demos/Query.cs @@ -120,7 +120,7 @@ namespace OrmTest.Demo var db = GetInstance(); var getAll = db.Queryable().ToList(); var getId = db.Queryable().Select(it => it.Id).ToList(); - // var getIdIIF= db.Queryable().Select(it =>new { id = SqlFunc.IIF(it.Id == 0, 1, it.Id) }).ToList(); + var getIdIIF= db.Queryable().Select(it =>new { id = SqlFunc.IIF(it.Id == 0, 1, it.Id),it.Name,it.SchoolId }).ToList(); var getAllNoLock = db.Queryable().With(SqlWith.NoLock).ToList(); var getByPrimaryKey = db.Queryable().InSingle(2); var getSingleOrDefault = db.Queryable().Single(); diff --git a/SqlServerTest/Program.cs b/SqlServerTest/Program.cs index caafd709e..114e595ba 100644 --- a/SqlServerTest/Program.cs +++ b/SqlServerTest/Program.cs @@ -18,18 +18,18 @@ namespace OrmTest static void Main(string[] args) { /***Unit Test***/ - new Field(1).Init(); - new Where(1).Init(); - new Method(1).Init(); - new JoinQuery(1).Init(); - new SingleQuery(1).Init(); - new SelectQuery(1).Init(); - new AutoClose(1).Init(); - new Insert(1).Init(); - new Delete(1).Init(); - new Update(1).Init(); - new Mapping(1).Init(); - new DataTest(1).Init(); + //new Field(1).Init(); + //new Where(1).Init(); + //new Method(1).Init(); + //new JoinQuery(1).Init(); + //new SingleQuery(1).Init(); + //new SelectQuery(1).Init(); + //new AutoClose(1).Init(); + //new Insert(1).Init(); + //new Delete(1).Init(); + //new Update(1).Init(); + //new Mapping(1).Init(); + //new DataTest(1).Init(); /***Performance Test***/ new SqlSugarPerformance(100).Select(); diff --git a/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs b/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs index 400bb127e..69c47a37e 100644 --- a/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs +++ b/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs @@ -185,7 +185,7 @@ namespace SqlSugar protected MethodCallExpressionArgs GetMethodCallArgs(ExpressionParameter parameter, Expression item) { var newContext = this.Context.GetCopyContext(); - newContext.Resolve(item, this.Context.ResolveType); + newContext.Resolve(item, this.Context.IsJoin?ResolveExpressType.WhereMultiple:ResolveExpressType.WhereSingle); this.Context.Index = newContext.Index; this.Context.ParameterIndex = newContext.ParameterIndex; if (newContext.Parameters.IsValuable())