Browse Source

Check NullOrEmpty for sortings instead of null coalescing in TenantManagement

pull/8178/head
enisn 6 years ago
parent
commit
4948fca516
  1. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs
  2. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs

2
modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs

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

2
modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs

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

Loading…
Cancel
Save