Class DomainTags
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
Entity
The domain entity type name (e.g., "Order", "User").
public static readonly TagKey<string> Entity
Field Value
EntityId
The domain entity identifier.
public static readonly TagKey<string> EntityId
Field Value
Field
The field name involved in a validation or conflict error.
public static readonly TagKey<string> Field
Field Value
Operation
The operation or action name (e.g., "Delete", "Publish").
public static readonly TagKey<string> Operation
Field Value
OperationName
The pipeline operation name used when injecting OperationName into error tags.
public static readonly TagKey<string> OperationName
Field Value
TenantId
The tenant identifier used when injecting TenantId into error tags.
public static readonly TagKey<string> TenantId
Field Value
Value
The conflicting or invalid value. Can be any type.
public static readonly TagKey<object?> Value