Browse Source

Update AuditLogRepository

pull/6396/head
liangshiwei 6 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); return result.ToDictionary(element => element.Day.ClearTime(), element => element.avgExecutionTime);
} }
public override IQueryable<AuditLog> WithDetails() public override IQueryable<AuditLog> WithDetails()
{ {
return GetQueryable().IncludeDetails(); return GetQueryable().IncludeDetails();
@ -147,8 +147,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
var entityChange = await DbContext.Set<EntityChange>() var entityChange = await DbContext.Set<EntityChange>()
.AsNoTracking() .AsNoTracking()
.IncludeDetails() .IncludeDetails()
.OrderBy(x => x.Id)
.Where(x => x.Id == entityChangeId) .Where(x => x.Id == entityChangeId)
.OrderBy(x => x.Id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
if (entityChange == null) 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) public virtual async Task<EntityChange> GetEntityChange(Guid entityChangeId)
{ {
var entityChange = (await GetMongoQueryable() var entityChange = (await GetMongoQueryable()
.OrderBy(x => x.Id)
.Where(x => x.EntityChanges.Any(y => y.Id == entityChangeId)) .Where(x => x.EntityChanges.Any(y => y.Id == entityChangeId))
.OrderBy(x => x.Id)
.FirstAsync()).EntityChanges.FirstOrDefault(x => x.Id == entityChangeId); .FirstAsync()).EntityChanges.FirstOrDefault(x => x.Id == entityChangeId);

Loading…
Cancel
Save