Skip to content

Commit 1773cb3

Browse files
committed
增加排序表达式的null判断
1 parent e23262f commit 1773cb3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Vue.Net/VOL.Core/Extensions/LambdaExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ exp.Arguments[0] is MemberExpression ?
294294
/// <returns></returns>
295295
public static Dictionary<string, QueryOrderBy> GetExpressionToDic<T>(this Expression<Func<T, Dictionary<object, QueryOrderBy>>> expression)
296296
{
297+
//2020.09.14增加排序字段null值判断
298+
if (expression == null)
299+
{
300+
return new Dictionary<string, QueryOrderBy>();
301+
}
297302
return expression.GetExpressionToPair().Reverse().ToList().ToDictionary(x => x.Key, x => x.Value);
298303
}
299304
/// <summary>

开发版dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/LambdaExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ exp.Arguments[0] is MemberExpression ?
294294
/// <returns></returns>
295295
public static Dictionary<string, QueryOrderBy> GetExpressionToDic<T>(this Expression<Func<T, Dictionary<object, QueryOrderBy>>> expression)
296296
{
297+
//2020.09.14增加排序字段null值判断
298+
if (expression == null)
299+
{
300+
return new Dictionary<string, QueryOrderBy>();
301+
}
297302
return expression.GetExpressionToPair().Reverse().ToList().ToDictionary(x => x.Key, x => x.Value);
298303
}
299304
/// <summary>

0 commit comments

Comments
 (0)