Browse Source

Update Order By

pull/25/head
sunkaixuan 2 years ago
parent
commit
9993785f94
  1. 4
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs

4
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs

@ -977,7 +977,7 @@ namespace SqlSugar
var result = ""; var result = "";
foreach (var item in newExp.Arguments) foreach (var item in newExp.Arguments)
{ {
if (item is MemberExpression) if (item is MemberExpression&&type==OrderByType.Asc)
{ {
result += result +=
QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.FieldSingle : ResolveExpressType.FieldMultiple).GetResultString() + ","; QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.FieldSingle : ResolveExpressType.FieldMultiple).GetResultString() + ",";
@ -985,7 +985,7 @@ namespace SqlSugar
else if (type == OrderByType.Desc) else if (type == OrderByType.Desc)
{ {
result += result +=
QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple).GetResultString() + "Desc ,"; QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple).GetResultString() + " Desc ,";
} }
else else
{ {

Loading…
Cancel
Save