Browse Source

Update AuditLogRepository

pull/6396/head
liangshiwei 5 years ago
parent
commit
627bf52bb0
  1. 4
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
  2. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

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

@ -136,7 +136,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
return result.ToDictionary(element => element.Day.ClearTime(), element => element.avgExecutionTime);
}
public override IQueryable<AuditLog> WithDetails()
{
return GetQueryable().IncludeDetails();
@ -147,8 +147,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
var entityChange = await DbContext.Set<EntityChange>()
.AsNoTracking()
.IncludeDetails()
.OrderBy(x => x.Id)
.Where(x => x.Id == entityChangeId)
.OrderBy(x => x.Id)
.FirstOrDefaultAsync();
if (entityChange == null)

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

@ -144,8 +144,8 @@ namespace Volo.Abp.AuditLogging.MongoDB
public virtual async Task<EntityChange> GetEntityChange(Guid entityChangeId)
{
var entityChange = (await GetMongoQueryable()
.OrderBy(x => x.Id)
.Where(x => x.EntityChanges.Any(y => y.Id == entityChangeId))
.OrderBy(x => x.Id)
.FirstAsync()).EntityChanges.FirstOrDefault(x => x.Id == entityChangeId);

Loading…
Cancel
Save