Browse Source

Update exp to sql

pull/12/head
sunkaixuna 3 years ago
parent
commit
d06cb08e0d
  1. 11
      Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UQueryable.cs
  2. 2
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs

11
Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/UnitTest/UQueryable.cs

@ -96,6 +96,12 @@ namespace OrmTest
}).ToSql();
UValidate.Check(x.Key, "SELECT [a] AS [a] FROM [BoolTest2] ", "Queryable");
Db.CodeFirst.InitTables<BoolTest3>();
var blist3= Db.Queryable<BoolTest3>().Select(it => new BoolTest3()
{
a = string.IsNullOrEmpty(it.Name)
}).ToList();
var db = Db;
db.CodeFirst.InitTables<UserInfo, UserIpRuleInfo>();
db.Deleteable<UserInfo>().ExecuteCommand();
@ -519,4 +525,9 @@ namespace OrmTest
{
public bool? a { get; set; }
}
public class BoolTest3
{
public bool? a { get; set; }
public string Name { get; set; }
}
}

2
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs

@ -483,7 +483,7 @@ namespace SqlSugar
}
}
}
else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression && (item as MethodCallExpression).Method.Name == "Any"&&IsSubMethod(item as MethodCallExpression))
else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression)
{
this.Expression = item;
this.Start();

Loading…
Cancel
Save