public void Process <TEntity>(TEntity entity, BulkInsertOperation operation, BulkInsertOptions options) where TEntity : class { var timestamp = _clock.GetCurrentInstant().ToDateTimeUtc(); if (entity is IAuditEntity auditEntity) { AuditEntityHelper.SetAudit(auditEntity, GetAuditEntityState(auditEntity, operation), timestamp); } }
public void AddAuditInfo <TEntity>(params TEntity[] entities) where TEntity : class, IAuditEntity { if (!(entities ?? throw new ArgumentNullException(nameof(entities))).Any()) { return; } var timestamp = _clock.GetCurrentInstant().ToDateTimeUtc(); foreach (var entity in entities) { AuditEntityHelper.SetAudit(entity, GetAuditEntityState(entity), timestamp); } }