Browse Source

Audit Logging getalllistasync fixes

pull/395/head
Yunus Emre Kalkan 8 years ago
parent
commit
c31c5d1d34
  1. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs
  2. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
  3. 10
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

2
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs

@ -16,7 +16,7 @@ namespace Volo.Abp.AuditLogging
string url = null,
string userName = null,
HttpStatusCode? httpStatusCode = null,
bool includeDetails = false);
bool includeDetails = true);
Task<long> GetCountAsync(
string httpMethod = null,

2
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs

@ -30,7 +30,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
{
var query = GetListQuery(httpMethod, url, userName, httpStatusCode, includeDetails);
var auditLogs = await query.OrderBy(sorting)
var auditLogs = await query.OrderBy(sorting ?? "executionTime desc")
.PageBy(skipCount, maxResultCount)
.ToListAsync();

10
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

@ -20,20 +20,22 @@ namespace Volo.Abp.AuditLogging.MongoDB
}
public async Task<List<AuditLog>> GetListAsync(string sorting = null, int maxResultCount = 50, int skipCount = 0,
string httpMethod = null, string url = null, string userName = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = false)
string httpMethod = null, string url = null, string userName = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = true)
{
var query = GetListQuery(httpMethod, url, userName, httpStatusCode, includeDetails);
return await query.OrderBy(sorting).As<IMongoQueryable<AuditLog>>()
return await query.OrderBy(sorting ?? "executionTime desc").As<IMongoQueryable<AuditLog>>()
.PageBy<AuditLog, IMongoQueryable<AuditLog>>(skipCount, maxResultCount)
.ToListAsync();
}
public async Task<long> GetCountAsync(string httpMethod = null, string url = null, string userName = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = false)
public async Task<long> GetCountAsync(string httpMethod = null, string url = null, string userName = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = true)
{
var query = GetListQuery(httpMethod, url, userName, httpStatusCode, includeDetails);
return await query.As<IMongoQueryable<AuditLog>>().LongCountAsync();
var count = await query.As<IMongoQueryable<AuditLog>>().LongCountAsync();
return count;
}
private IQueryable<AuditLog> GetListQuery(

Loading…
Cancel
Save