Browse Source

Improve default sorting fallback expressions

pull/8074/head
Halil İbrahim Kalkan 6 years ago
parent
commit
726d91f771
  1. 2
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EFCoreIdentitySecurityLogRepository.cs
  2. 2
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs

2
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EFCoreIdentitySecurityLogRepository.cs

@ -49,7 +49,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
cancellationToken cancellationToken
); );
return await query.OrderBy(sorting ?? nameof(IdentitySecurityLog.CreationTime) + " desc") return await query.OrderBy(sorting.IsNullOrWhiteSpace() ? $"{nameof(IdentitySecurityLog.CreationTime)} desc" : sorting)
.PageBy(skipCount, maxResultCount) .PageBy(skipCount, maxResultCount)
.ToListAsync(cancellationToken); .ToListAsync(cancellationToken);
} }

2
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs

@ -48,7 +48,7 @@ namespace Volo.Abp.Identity.MongoDB
cancellationToken cancellationToken
); );
return await query.OrderBy(sorting ?? nameof(IdentitySecurityLog.CreationTime) + " desc") return await query.OrderBy(sorting.IsNullOrWhiteSpace() ? $"{nameof(IdentitySecurityLog.CreationTime)} desc" : sorting)
.As<IMongoQueryable<IdentitySecurityLog>>() .As<IMongoQueryable<IdentitySecurityLog>>()
.PageBy<IdentitySecurityLog, IMongoQueryable<IdentitySecurityLog>>(skipCount, maxResultCount) .PageBy<IdentitySecurityLog, IMongoQueryable<IdentitySecurityLog>>(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken)); .ToListAsync(GetCancellationToken(cancellationToken));

Loading…
Cancel
Save