Table of Contents

Class ActivityAudited

Namespace
Excalibur.A3.Audit.Events
Assembly
Excalibur.A3.dll

Represents an audited activity, capturing details about an activity performed in the system, including metadata for auditing purposes.

[MessageName("Excalibur.A3.ActivityAudited")]
public sealed record ActivityAudited : DomainEvent, IEquatable<DomainEvent>, IActivityAudited, IDomainEvent, IDispatchEvent, IDispatchMessage, IAuditIdentity, IAuditContext, IAuditResult, IEquatable<ActivityAudited>
Inheritance
ActivityAudited
Implements
Inherited Members

Constructors

ActivityAudited()

Initializes a new instance of the ActivityAudited class.

public ActivityAudited()

ActivityAudited(IActivityAudited)

Initializes a new instance of the ActivityAudited class by copying properties from an existing IActivityAudited instance.

[SetsRequiredMembers]
public ActivityAudited(IActivityAudited audit)

Parameters

audit IActivityAudited

The IActivityAudited instance to copy data from.

Exceptions

ArgumentNullException

Thrown if audit is null .

Properties

ActivityName

Gets the name of the activity being audited.

public required string ActivityName { get; init; }

Property Value

string

The name of the activity being audited.

ActivityTimestamp

Gets the timestamp of the audited activity.

public DateTimeOffset ActivityTimestamp { get; init; }

Property Value

DateTimeOffset

Remarks

This is the application-level activity timestamp, distinct from OccurredAt which tracks when the event was created.

ApplicationName

Gets the name of the application where the activity occurred.

public required string ApplicationName { get; init; }

Property Value

string

The name of the application where the activity occurred.

ClientAddress

Gets the client address (e.g., IP address) associated with the activity.

public string? ClientAddress { get; init; }

Property Value

string

The client address, or null if not available.

CorrelationId

Gets the correlation ID used to trace the activity across distributed systems or services.

public Guid CorrelationId { get; init; }

Property Value

Guid

The correlation ID used to trace the activity across distributed systems or services.

Remarks

This hides the CorrelationId property with a strongly-typed Guid version.

Exception

Gets exception details, if any, related to the activity.

public string? Exception { get; init; }

Property Value

string

The exception details, or null if no exception occurred.

Login

Gets the login identifier (e.g., email) of the user performing the activity.

public string? Login { get; init; }

Property Value

string

The login identifier, or null if not available.

Request

Gets the request payload or details associated with the activity.

public required string Request { get; init; }

Property Value

string

The request payload or details associated with the activity.

Response

Gets the response payload or details associated with the activity, if applicable.

public string? Response { get; init; }

Property Value

string

The response payload, or null if not applicable.

StatusCode

Gets or sets the HTTP status code returned as a result of the activity.

public int StatusCode { get; set; }

Property Value

int

The HTTP status code returned as a result of the activity.

TenantId

Gets the tenant identifier associated with the activity.

public string? TenantId { get; init; }

Property Value

string

The tenant identifier, or null if not in a multi-tenant context.

UserId

Gets the user identifier of the individual performing the activity.

public required string UserId { get; init; }

Property Value

string

The user identifier of the individual performing the activity.

UserName

Gets the name of the user performing the activity.

public required string UserName { get; init; }

Property Value

string

The name of the user performing the activity.