From 9993785f948bdc4b8a567a471abb6a9944f9ae5b Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 8 Nov 2022 16:59:29 +0800 Subject: [PATCH] Update Order By --- .../SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs index 6640ba80f..298626ab6 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs @@ -977,7 +977,7 @@ namespace SqlSugar var result = ""; foreach (var item in newExp.Arguments) { - if (item is MemberExpression) + if (item is MemberExpression&&type==OrderByType.Asc) { result += QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.FieldSingle : ResolveExpressType.FieldMultiple).GetResultString() + ","; @@ -985,7 +985,7 @@ namespace SqlSugar else if (type == OrderByType.Desc) { result += - QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple).GetResultString() + "Desc ,"; + QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple).GetResultString() + " Desc ,"; } else {