Class DomainTags

Namespace
REslava.Result
Assembly
REslava.Result.dll

Predefined TagKey<T> constants for domain error context. Used by built-in error factories and available for custom errors and queries.

public static class DomainTags
Inheritance
DomainTags
Inherited Members

Examples

// Read with type safety
if (error.TryGet(DomainTags.Entity, out var entity))
    logger.LogError("Entity {Entity} failed", entity);

// Write with type safety
var error = new Error("Something failed")
    .WithTag(DomainTags.Entity, "Order")
    .WithTag(DomainTags.EntityId, orderId.ToString());

Fields

CorrelationId

The correlation / trace identifier for distributed tracing.

public static readonly TagKey<string> CorrelationId

Field Value

TagKey<string>

Entity

The domain entity type name (e.g., "Order", "User").

public static readonly TagKey<string> Entity

Field Value

TagKey<string>

EntityId

The domain entity identifier.

public static readonly TagKey<string> EntityId

Field Value

TagKey<string>

Field

The field name involved in a validation or conflict error.

public static readonly TagKey<string> Field

Field Value

TagKey<string>

Operation

The operation or action name (e.g., "Delete", "Publish").

public static readonly TagKey<string> Operation

Field Value

TagKey<string>

OperationName

The pipeline operation name used when injecting OperationName into error tags.

public static readonly TagKey<string> OperationName

Field Value

TagKey<string>

TenantId

The tenant identifier used when injecting TenantId into error tags.

public static readonly TagKey<string> TenantId

Field Value

TagKey<string>

Value

The conflicting or invalid value. Can be any type.

public static readonly TagKey<object?> Value

Field Value

TagKey<object>