Class AuditExtensions
- Namespace
- WorkflowForge.Extensions.Audit
- Assembly
- WorkflowForge.Extensions.Audit.dll
Extension methods for adding audit capabilities to WorkflowForge.
public static class AuditExtensions
- Inheritance
-
AuditExtensions
- Inherited Members
Methods
UseAudit(IWorkflowFoundry, IAuditProvider, AuditMiddlewareOptions?, ISystemTimeProvider?, string?)
Enables audit logging for the workflow foundry with configurable options.
public static IWorkflowFoundry UseAudit(this IWorkflowFoundry foundry, IAuditProvider auditProvider, AuditMiddlewareOptions? options = null, ISystemTimeProvider? timeProvider = null, string? initiatedBy = null)
Parameters
foundryIWorkflowFoundryThe workflow foundry.
auditProviderIAuditProviderThe audit provider for storing audit entries.
optionsAuditMiddlewareOptionsOptional configuration options. If null, default options are used.
timeProviderISystemTimeProviderOptional time provider for timestamps.
initiatedBystringOptional user/system identifier that initiated the workflow.
Returns
- IWorkflowFoundry
The foundry for method chaining.
Exceptions
- ArgumentNullException
Thrown when required parameters are null.
- ArgumentException
Thrown when options validation fails.
WriteCustomAuditAsync(IWorkflowFoundry, IAuditProvider, string, AuditEventType, string, ISystemTimeProvider?, string?)
Writes a custom audit entry to the audit provider.
public static Task WriteCustomAuditAsync(this IWorkflowFoundry foundry, IAuditProvider auditProvider, string operationName, AuditEventType eventType, string status, ISystemTimeProvider? timeProvider = null, string? initiatedBy = null)
Parameters
foundryIWorkflowFoundryThe workflow foundry.
auditProviderIAuditProviderThe audit provider.
operationNamestringThe name of the operation being audited.
eventTypeAuditEventTypeThe type of audit event.
statusstringThe status of the operation.
timeProviderISystemTimeProviderOptional time provider for timestamps.
initiatedBystringOptional user/system identifier.
Returns
- Task
A task representing the asynchronous operation.