Table of Contents

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
object
CorrelationId
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

value Guid

The Guid value to assign the role of CorrelationId.

CorrelationId(string)

Initializes a new instance of the CorrelationId class.

public CorrelationId(string value)

Parameters

value string

The string value to assign the role of CorrelationId.

Exceptions

ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty or consist only of white-space characters.

ArgumentOutOfRangeException

value contained one or more white-space characters -or- value was less than 32 characters -or- value was greater than 128 characters -or- value consist 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

value Guid

The 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

value string

The value to convert.

Returns

CorrelationId

A CorrelationId that is equivalent to value.

See Also