From 298c7de53288494f5e0f8d64f10881b9324c413b Mon Sep 17 00:00:00 2001 From: YongQuan <79885120+YongQuan-dotnet@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:58:11 +1000 Subject: [PATCH] fix(module: table): rectify how to check if an IQueryable is IOrderedQueryable (#2710) --- components/table/TableModels/SortModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/table/TableModels/SortModel.cs b/components/table/TableModels/SortModel.cs index dfd72372..3082431a 100644 --- a/components/table/TableModels/SortModel.cs +++ b/components/table/TableModels/SortModel.cs @@ -62,8 +62,9 @@ namespace AntDesign.TableModels var lambda = (Expression>)_getFieldExpression; - if (source is IOrderedQueryable orderedSource) + if (source.Expression.Type == typeof(IOrderedQueryable)) { + var orderedSource = source as IOrderedQueryable; if (_sortDirection == SortDirection.Ascending) { return _comparer == null ? orderedSource.ThenBy(lambda) : orderedSource.ThenBy(lambda, this);