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
CorrelationId
Gets the correlation ID for tracking related operations.
public string? CorrelationId { get; init; }
Property Value
Environment
Gets the environment name (e.g., "Development", "Production").
public string? Environment { get; init; }
Property Value
Properties
Gets additional context properties.
public IReadOnlyDictionary<string, object?> Properties { get; init; }
Property Value
Timestamp
Gets the timestamp of the operation.
public DateTimeOffset Timestamp { get; init; }
Property Value
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
correlationIdstringThe correlation ID.
Returns
- DomainContext
A new domain context.