Browse Source

4.6.0.6

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
91815b6b8e
  1. 8
      Src/Asp.Net/SqlServerTest/UnitTest/Query/SingleQuery.cs
  2. 2
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs
  3. 4
      Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs

8
Src/Asp.Net/SqlServerTest/UnitTest/Query/SingleQuery.cs

@ -124,6 +124,14 @@ namespace OrmTest.UnitTest
new SugarParameter("@Id0",1), new SugarParameter("@Id0",1),
new SugarParameter("@Const1",1) new SugarParameter("@Const1",1)
}, t13.Key, t13.Value, "single t13 error "); }, t13.Key, t13.Value, "single t13 error ");
var t14 = db.Queryable<Student>()
.Where(it => it.Name == "a" && SqlFunc.HasValue(it.Name)).ToSql();
base.Check("SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE (( [Name] = @Name0 ) AND ( [Name]<>'' AND [Name] IS NOT NULL ))",
new List<SugarParameter>() {
new SugarParameter("@Name0","a")
}, t14.Key, t14.Value, "single t14 error ");
} }
} }
} }

2
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

@ -209,7 +209,7 @@ namespace SqlSugar
model.Args.AddRange(appendArgs); model.Args.AddRange(appendArgs);
} }
var methodValue = GetMdthodValue(name, model); var methodValue = GetMdthodValue(name, model);
if (parameter.BaseExpression is BinaryExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType&&name=="HasValue") { if (parameter.BaseExpression is BinaryExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType&&name=="HasValue"&&!(parameter.OppsiteExpression is BinaryExpression)) {
methodValue = this.Context.DbMehtods.CaseWhen(new List<KeyValuePair<string, string>>() { methodValue = this.Context.DbMehtods.CaseWhen(new List<KeyValuePair<string, string>>() {
new KeyValuePair<string, string>("IF",methodValue.ObjToString()), new KeyValuePair<string, string>("IF",methodValue.ObjToString()),
new KeyValuePair<string, string>("Return","1"), new KeyValuePair<string, string>("Return","1"),

4
Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.6.0.5")] [assembly: AssemblyVersion("4.6.0.6")]
[assembly: AssemblyFileVersion("4.6.0.5")] [assembly: AssemblyFileVersion("4.6.0.6")]

Loading…
Cancel
Save