Table of Contents

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

foundry IWorkflowFoundry

The workflow foundry.

auditProvider IAuditProvider

The audit provider for storing audit entries.

options AuditMiddlewareOptions

Optional configuration options. If null, default options are used.

timeProvider ISystemTimeProvider

Optional time provider for timestamps.

initiatedBy string

Optional 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

foundry IWorkflowFoundry

The workflow foundry.

auditProvider IAuditProvider

The audit provider.

operationName string

The name of the operation being audited.

eventType AuditEventType

The type of audit event.

status string

The status of the operation.

timeProvider ISystemTimeProvider

Optional time provider for timestamps.

initiatedBy string

Optional user/system identifier.

Returns

Task

A task representing the asynchronous operation.