Class CorrelationId
- Namespace
- Codebelt.SharedKernel
- Assembly
- Codebelt.SharedKernel.dll
Represents a CorrelationId object that can be used as unique identifier that help you trace requests across multiple services in a distributed system.
public record CorrelationId : Token, IEquatable<ValueObject>, IEquatable<SingleValueObject<string>>, IEquatable<Token>, IEquatable<CorrelationId>
- Inheritance
-
objectCorrelationId
- Implements
- Inherited Members
-
SingleValueObject<string>.ToString()SingleValueObject<string>.GetHashCode()SingleValueObject<string>.Equals(object)SingleValueObject<string>.Equals(ValueObject)SingleValueObject<string>.Equals(SingleValueObject<string>)SingleValueObject<string>.<Clone>$()SingleValueObject<string>.EqualityContract
Remarks
Constructors
CorrelationId(Guid)
Initializes a new instance of the CorrelationId class.
public CorrelationId(Guid value)
Parameters
valueGuidThe Guid value to assign the role of CorrelationId.
CorrelationId(string)
Initializes a new instance of the CorrelationId class.
public CorrelationId(string value)
Parameters
valuestringThe string value to assign the role of CorrelationId.
Exceptions
- ArgumentNullException
valuecannot be null.- ArgumentException
valuecannot be empty or consist only of white-space characters.- ArgumentOutOfRangeException
valuecontained one or more white-space characters -or-valuewas less than 32 characters -or-valuewas greater than 128 characters -or-valueconsist only of same repeated character.
Operators
implicit operator CorrelationId(Guid)
Performs an implicit conversion from Guid to CorrelationId.
public static implicit operator CorrelationId(Guid value)
Parameters
valueGuidThe value to convert.
Returns
- CorrelationId
A CorrelationId that is equivalent to
value.
implicit operator CorrelationId(string)
Performs an implicit conversion from string to CorrelationId.
public static implicit operator CorrelationId(string value)
Parameters
valuestringThe value to convert.
Returns
- CorrelationId
A CorrelationId that is equivalent to
value.