fix(module: table): rectify how to check if an IQueryable is IOrderedQueryable (#2710)

This commit is contained in:
YongQuan 2022-09-14 22:58:11 +10:00 committed by GitHub
parent fc9aaa8781
commit 298c7de532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,8 +62,9 @@ namespace AntDesign.TableModels
var lambda = (Expression<Func<TItem, TField>>)_getFieldExpression;
if (source is IOrderedQueryable<TItem> orderedSource)
if (source.Expression.Type == typeof(IOrderedQueryable<TItem>))
{
var orderedSource = source as IOrderedQueryable<TItem>;
if (_sortDirection == SortDirection.Ascending)
{
return _comparer == null ? orderedSource.ThenBy(lambda) : orderedSource.ThenBy(lambda, this);