Skip to content

Commit

Permalink
3.1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
DotNetNext committed Oct 28, 2016
1 parent 8d943e3 commit 75b32ca
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion NewTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static void Main(string[] args)
{

//设置执行的DEMO
string switchOn = "insert";
string switchOn = "select";
IDemos demo = null;
switch (switchOn)
{
Expand Down
Binary file modified SqlSugar.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions SqlSugar/Core/ResolveExpress/Expressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private string BinaryExpression(Expression exp)
else
{
var oldLeft = AddParas(ref left, parValue);
return string.Format(" ({0} {1} " + SqlSugarTool.ParSymbol + "{2}) ", oldLeft, oper, left);
return string.Format(" ({0} {1} " + SqlSugarTool.ParSymbol + "{2}) ", oldLeft.GetTranslationSqlName(), oper, left);
}
}
else if (isValueOperKey)
Expand All @@ -290,7 +290,7 @@ private string BinaryExpression(Expression exp)
else
{
var oldRight = AddParasReturnRight(parValue, ref right);
return string.Format("( " + SqlSugarTool.ParSymbol + "{0} {1} {2} )", right, oper, oldRight);
return string.Format("( " + SqlSugarTool.ParSymbol + "{0} {1} {2} )", right, oper, oldRight.GetTranslationSqlName());
}
}
else if (leftType == MemberType.Value && rightType == MemberType.Value)
Expand Down
10 changes: 5 additions & 5 deletions SqlSugar/Core/ResolveExpress/Method.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private string Equals(string methodName, MethodCallExpression mce) {
var right = mce.Arguments[0].NodeType.IsIn(ExpressionType.Constant, ExpressionType.MemberAccess) ? CreateSqlElements(mce.Arguments[0], ref rightType, true) : Expression.Lambda(mce.Arguments[0]).Compile().DynamicInvoke().ObjToString();
Check.Exception(leftType == MemberType.Value, string.Format(ExpMethodError,methodName));
var oldLeft = AddParas(ref left,right);
return string.Format("({0} = " + SqlSugarTool.ParSymbol + "{1})", oldLeft, left);
return string.Format("({0} = " + SqlSugarTool.ParSymbol + "{1})", oldLeft.GetTranslationSqlName(), left);
}

/// <summary>
Expand All @@ -41,7 +41,7 @@ private string StartsWith(string methodName, MethodCallExpression mce, bool isTu
var right = mce.Arguments[0].NodeType.IsIn(ExpressionType.Constant, ExpressionType.MemberAccess) ? CreateSqlElements(mce.Arguments[0], ref rightType, true) : Expression.Lambda(mce.Arguments[0]).Compile().DynamicInvoke().ObjToString();
Check.Exception(leftType == MemberType.Value, string.Format(ExpMethodError, methodName));
var oldLeft = AddParas(ref left, right + '%');
return string.Format("({0} {1} LIKE " + SqlSugarTool.ParSymbol + "{2})", oldLeft, null, left);
return string.Format("({0} {1} LIKE " + SqlSugarTool.ParSymbol + "{2})", oldLeft.GetTranslationSqlName(), null, left);
}

/// <summary>
Expand All @@ -59,7 +59,7 @@ private string EndWith(string methodName, MethodCallExpression mce, bool isTure)
var right = mce.Arguments[0].NodeType.IsIn(ExpressionType.Constant, ExpressionType.MemberAccess) ? CreateSqlElements(mce.Arguments[0], ref rightType, true) : Expression.Lambda(mce.Arguments[0]).Compile().DynamicInvoke().ObjToString();
Check.Exception(leftType == MemberType.Value, string.Format(ExpMethodError, methodName));
var oldLeft = AddParas(ref left, '%' + right);
return string.Format("({0} {1} LIKE " + SqlSugarTool.ParSymbol + "{2})", oldLeft, null, left);
return string.Format("({0} {1} LIKE " + SqlSugarTool.ParSymbol + "{2})", oldLeft.GetTranslationSqlName(), null, left);
}

/// <summary>
Expand Down Expand Up @@ -104,7 +104,7 @@ private string Contains(string methodName, MethodCallExpression mce, bool isTure
return (" (1=2) ");
}
var inValue = inArray.ToArray().ToJoinSqlInVal();
return string.Format("({0} IN ({1}))", fieldName, inValue);
return string.Format("({0} IN ({1}))", fieldName.GetTranslationSqlName(), inValue);
}
else if (mce.Arguments.Count == 2) { //两个值
//object containsValue = null;
Expand All @@ -119,7 +119,7 @@ private string Contains(string methodName, MethodCallExpression mce, bool isTure
{
Check.Exception(leftType == MemberType.Value, string.Format(ExpMethodError, methodName));
var oldLeft = AddParas(ref left, '%' + right + '%');
return string.Format("({0} {1} LIKE " + SqlSugarTool.ParSymbol + "{2})", oldLeft, null, left);
return string.Format("({0} {1} LIKE " + SqlSugarTool.ParSymbol + "{2})", oldLeft.GetTranslationSqlName(), null, left);
}
}

Expand Down
4 changes: 2 additions & 2 deletions SqlSugar/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.1.4")]
[assembly: AssemblyFileVersion("3.1.1.4")]
[assembly: AssemblyVersion("3.1.1.5")]
[assembly: AssemblyFileVersion("3.1.1.5")]
6 changes: 3 additions & 3 deletions SqlSugar/Queryable/QueryableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public static Queryable<T> In<T, FieldType>(this Queryable<T> queryable, string
var type = queryable.Type;
queryable.WhereIndex = queryable.WhereIndex + 100;
ResolveExpress re = new ResolveExpress(queryable.WhereIndex);
queryable.WhereValue.Add(string.Format(" AND {0} IN ({1})", InFieldName, inValues.ToJoinSqlInVal()));
queryable.WhereValue.Add(string.Format(" AND {0} IN ({1})", InFieldName.GetTranslationSqlName(), inValues.ToJoinSqlInVal()));
return queryable;
}

Expand Down Expand Up @@ -282,7 +282,7 @@ public static Queryable<T> OrderBy<T>(this Queryable<T> queryable, Expression<Fu
field = re.GetExpressionRightFieldByNT(expression, queryable.DB);
}
var pre = queryable.OrderByValue.IsValuable() ? "," : "";
queryable.OrderByValue += pre + field + " " + type.ToString().ToUpper();
queryable.OrderByValue += pre + field.GetTranslationSqlName() + " " + type.ToString().ToUpper();
return queryable;
}

Expand All @@ -300,7 +300,7 @@ public static Queryable<T> OrderBy<T, T2>(this Queryable<T> queryable, Expressio
ResolveExpress re = new ResolveExpress();
var field = re.GetExpressionRightFieldByNT(expression, queryable.DB);
var pre = queryable.OrderByValue.IsValuable() ? "," : "";
queryable.OrderByValue += pre + field + " " + type.ToString().ToUpper();
queryable.OrderByValue += pre + field.GetTranslationSqlName() + " " + type.ToString().ToUpper();
return queryable;
}

Expand Down
Binary file modified SqlSugar/bin/Debug/SqlSugar.dll
Binary file not shown.
Binary file modified SqlSugar/bin/Debug/SqlSugar.pdb
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions SqlSugar/obj/Debug/SqlSugar.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ E:\MyOpenSource\SqlSugar\SqlSugar\bin\Debug\SqlSugar.pdb
E:\MyOpenSource\SqlSugar\SqlSugar\obj\Debug\SqlSugar.dll
E:\MyOpenSource\SqlSugar\SqlSugar\obj\Debug\SqlSugar.pdb
E:\MyOpenSource\SqlSugar\SqlSugar\bin\Debug\SqlSugar.XML
E:\MyOpenSource\SqlSugar\SqlSugar\obj\Debug\SqlSugar.csprojResolveAssemblyReference.cache
Binary file modified SqlSugar/obj/Debug/SqlSugar.dll
Binary file not shown.

0 comments on commit 75b32ca

Please sign in to comment.