Table of Contents

Class DomainContext

Namespace
JD.Domain.Abstractions
Assembly
JD.Domain.Abstractions.dll

Provides context information for rule evaluation and domain operations.

public sealed class DomainContext
Inheritance
DomainContext
Inherited Members

Properties

Actor

Gets the user or actor identifier.

public string? Actor { get; init; }

Property Value

string

CorrelationId

Gets the correlation ID for tracking related operations.

public string? CorrelationId { get; init; }

Property Value

string

Environment

Gets the environment name (e.g., "Development", "Production").

public string? Environment { get; init; }

Property Value

string

Properties

Gets additional context properties.

public IReadOnlyDictionary<string, object?> Properties { get; init; }

Property Value

IReadOnlyDictionary<string, object>

Timestamp

Gets the timestamp of the operation.

public DateTimeOffset Timestamp { get; init; }

Property Value

DateTimeOffset

Methods

Empty()

Creates an empty domain context.

public static DomainContext Empty()

Returns

DomainContext

A new empty domain context.

WithCorrelationId(string)

Creates a domain context with the specified correlation ID.

public static DomainContext WithCorrelationId(string correlationId)

Parameters

correlationId string

The correlation ID.

Returns

DomainContext

A new domain context.