mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
4.1.0.7
This commit is contained in:
@@ -46,6 +46,7 @@ namespace OrmTest.UnitTest
|
||||
Trim();
|
||||
Contains();
|
||||
Contains2();
|
||||
Contains3();
|
||||
ContainsArray();
|
||||
StartsWith();
|
||||
EndsWith();
|
||||
@@ -428,6 +429,18 @@ namespace OrmTest.UnitTest
|
||||
new SugarParameter("@MethodConst0","a")
|
||||
}, "Contains2 error");
|
||||
}
|
||||
private void Contains3(string name = "a")
|
||||
{
|
||||
Expression<Func<Student, bool>> exp = it => !SqlFunc.Contains(it.Name, name)&&it.Id==1;
|
||||
SqlServerExpressionContext expContext = new SqlServerExpressionContext();
|
||||
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
|
||||
var value = expContext.Result.GetString();
|
||||
var pars = expContext.Parameters;
|
||||
base.Check(value, pars, "(NOT ([Name] like '%'+@MethodConst0+'%') AND( [Id] = @Id1 ))", new List<SugarParameter>() {
|
||||
new SugarParameter("@MethodConst0","a"),
|
||||
new SugarParameter("@Id1",1)
|
||||
}, "Contains3 error");
|
||||
}
|
||||
|
||||
private void ExtendContainsArray() {
|
||||
var array = new string[] { "1", "2" }.ToList();
|
||||
|
@@ -303,8 +303,16 @@ namespace SqlSugar
|
||||
}
|
||||
|
||||
protected void AppendNot(object Value)
|
||||
{
|
||||
var isAppend = !this.Context.Result.Contains(ExpressionConst.Format0);
|
||||
if (isAppend)
|
||||
{
|
||||
this.Context.Result.Append("NOT");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Context.Result.Replace(ExpressionConst.Format0, "NOT");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,8 +34,8 @@ namespace SqlSugar
|
||||
var lsrb = !leftIsBinary && rightBinary;
|
||||
var lbrb = rightBinary && leftIsBinary;
|
||||
var lsbs = !leftIsBinary && !rightBinary;
|
||||
var isBegin = !base.Context.Result.Contains(ExpressionConst.Format0);
|
||||
if (isBegin)
|
||||
var isAppend = !base.Context.Result.Contains(ExpressionConst.Format0);
|
||||
if (isAppend)
|
||||
{
|
||||
base.Context.Result.Append(ExpressionConst.Format3);
|
||||
base.Context.Result.Append(ExpressionConst.Format0);
|
||||
|
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("4.1.0.6")]
|
||||
[assembly: AssemblyFileVersion("4.1.0.6")]
|
||||
[assembly: AssemblyVersion("4.1.0.7")]
|
||||
[assembly: AssemblyFileVersion("4.1.0.7")]
|
||||
|
Reference in New Issue
Block a user