|
|
|
@ -23,8 +23,8 @@ namespace Volo.Abp.Auditing
|
|
|
|
|
private readonly IAuditingStore _auditingStore;
|
|
|
|
|
|
|
|
|
|
public AuditingManager(
|
|
|
|
|
IAmbientScopeProvider<IAuditLogScope> ambientScopeProvider,
|
|
|
|
|
IAuditingHelper auditingHelper,
|
|
|
|
|
IAmbientScopeProvider<IAuditLogScope> ambientScopeProvider,
|
|
|
|
|
IAuditingHelper auditingHelper,
|
|
|
|
|
IAuditingStore auditingStore,
|
|
|
|
|
IServiceProvider serviceProvider,
|
|
|
|
|
IOptions<AbpAuditingOptions> options)
|
|
|
|
@ -84,7 +84,7 @@ namespace Volo.Abp.Auditing
|
|
|
|
|
{
|
|
|
|
|
var changeGroups = auditLog.EntityChanges
|
|
|
|
|
.Where(e => e.ChangeType == EntityChangeType.Updated)
|
|
|
|
|
.GroupBy(e => new {e.EntityTypeFullName, e.EntityId})
|
|
|
|
|
.GroupBy(e => new { e.EntityTypeFullName, e.EntityId })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
foreach (var changeGroup in changeGroups)
|
|
|
|
@ -141,7 +141,7 @@ namespace Volo.Abp.Auditing
|
|
|
|
|
public DisposableSaveHandle(
|
|
|
|
|
AuditingManager auditingManager,
|
|
|
|
|
IDisposable scope,
|
|
|
|
|
AuditLogInfo auditLog,
|
|
|
|
|
AuditLogInfo auditLog,
|
|
|
|
|
Stopwatch stopWatch)
|
|
|
|
|
{
|
|
|
|
|
_auditingManager = auditingManager;
|
|
|
|
@ -150,15 +150,22 @@ namespace Volo.Abp.Auditing
|
|
|
|
|
StopWatch = stopWatch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task SaveAsync()
|
|
|
|
|
public async Task SaveAsync(Exception exception = null)
|
|
|
|
|
{
|
|
|
|
|
await _auditingManager.SaveAsync(this).ConfigureAwait(false);
|
|
|
|
|
if (exception != null)
|
|
|
|
|
{
|
|
|
|
|
this.AuditLog.Exceptions.Add(exception);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
await _auditingManager.SaveAsync(this).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
_scope.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|