Table of Contents

RequestToken Class

Definition

Namespace
Cuemon.Messaging
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Messaging/RequestToken.cs

Provides a default implementation of the IRequestToken interface.

public record RequestToken : IRequestToken, IEquatable<RequestToken>
Inheritance
RequestToken
Implements

Examples

The following example demonstrates how to use to uniquely identify an individual request within a system.

// Program.cs
using System;
using Cuemon.Messaging;

// Each request gets its own unique ID
var request1 = new RequestToken();
var request2 = new RequestToken();

Console.WriteLine($"Request 1 ID: {request1}");
Console.WriteLine($"Request 2 ID: {request2}");
Console.WriteLine($"Are they different? {request1.RequestId != request2.RequestId}");

Constructors

Name Description
RequestToken(string)

Initializes a new instance of the RequestToken class.

Properties

Name Description
RequestId

Gets the unique request identifier.

Methods

Name Description
ToString()

Returns a string that represents this instance.

See Also