Check NullOrEmpty for sortings instead of null coalescing in TenantManagement

pull/8178/head
enisn 4 years ago
parent 77f7fc64d9
commit 4948fca516

@ -62,7 +62,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore
u =>
u.Name.Contains(filter)
)
.OrderBy(sorting ?? nameof(Tenant.Name))
.OrderBy(sorting.IsNullOrEmpty() ? nameof(Tenant.Name) : sorting)
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}

@ -56,7 +56,7 @@ namespace Volo.Abp.TenantManagement.MongoDB
u =>
u.Name.Contains(filter)
)
.OrderBy(sorting ?? nameof(Tenant.Name))
.OrderBy(sorting.IsNullOrEmpty() ? nameof(Tenant.Name) : sorting)
.As<IMongoQueryable<Tenant>>()
.PageBy<Tenant, IMongoQueryable<Tenant>>(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));

Loading…
Cancel
Save