From 403513b633916d9ac09fbd5d32de98b360de80ae Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 11 Oct 2019 11:28:00 +0300 Subject: [PATCH] bugfix in audit log repos --- .../EntityFrameworkCore/EfCoreAuditLogRepository.cs | 4 ++-- .../Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs index 4564a6d7ae..094f946777 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs @@ -110,8 +110,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore .IncludeDetails(includeDetails) .WhereIf(startTime.HasValue, auditLog => auditLog.ExecutionTime >= startTime) .WhereIf(endTime.HasValue, auditLog => auditLog.ExecutionTime <= endTime) - .WhereIf(hasException.HasValue && hasException.Value, auditLog => auditLog.Exceptions != null) - .WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null) + .WhereIf(hasException.HasValue && hasException.Value, auditLog => auditLog.Exceptions != null && auditLog.Exceptions != "") + .WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions == "") .WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod == httpMethod) .WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.Contains(url)) .WhereIf(userName != null, auditLog => auditLog.UserName == userName) diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs index 1f090f81f2..a0e3c31961 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs @@ -109,8 +109,8 @@ namespace Volo.Abp.AuditLogging.MongoDB return GetMongoQueryable() .WhereIf(startTime.HasValue, auditLog => auditLog.ExecutionTime >= startTime) .WhereIf(endTime.HasValue, auditLog => auditLog.ExecutionTime <= endTime) - .WhereIf(hasException.HasValue && hasException.Value, auditLog => auditLog.Exceptions != null) - .WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null) + .WhereIf(hasException.HasValue && hasException.Value, auditLog => auditLog.Exceptions != null && auditLog.Exceptions != "") + .WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions == "") .WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod == httpMethod) .WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.Contains(url)) .WhereIf(userName != null, auditLog => auditLog.UserName == userName)