Browse Source

query order implemented

pull/3509/head
Ahmet 7 years ago
parent
commit
05df59b2a7
  1. 2
      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

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

@ -196,7 +196,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
public virtual async Task<List<EntityChangeWithUsername>> GetEntityChangesWithUsernameAsync(string entityId, string entityTypeFullName)
{
var query = DbContext.Set<EntityChange>().AsNoTracking().IncludeDetails().Where(x => x.EntityId == entityId && x.EntityTypeFullName == entityTypeFullName);
var query = DbContext.Set<EntityChange>().AsNoTracking().IncludeDetails().Where(x => x.EntityId == entityId && x.EntityTypeFullName == entityTypeFullName).OrderBy(x => x.ChangeTime);
return await (from e in query
join auditLog in DbSet on e.AuditLogId equals auditLog.Id

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

@ -207,7 +207,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
public virtual async Task<List<EntityChangeWithUsername>> GetEntityChangesWithUsernameAsync(string entityId, string entityTypeFullName)
{
var auditLogs = await GetMongoQueryable().Where(x =>
x.EntityChanges.Any(y => y.EntityId == entityId && y.EntityTypeFullName == entityTypeFullName)).As<IMongoQueryable<AuditLog>>().ToListAsync();
x.EntityChanges.Any(y => y.EntityId == entityId && y.EntityTypeFullName == entityTypeFullName)).As<IMongoQueryable<AuditLog>>().OrderBy(x => x.ExecutionTime).ToListAsync();
var entityChanges = auditLogs.SelectMany(x => x.EntityChanges).ToList();

Loading…
Cancel
Save