Class RequestToken
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
using System;
using Cuemon.Messaging;
namespace MyApp.Examples;
public class RequestTokenExample
{
public void Demonstrate()
{
// 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
RequestToken(string)
Initializes a new instance of the RequestToken class.
public RequestToken(string requestId = null)
Parameters
requestIdstringThe string that uniquely identifies a request. Default value is a GUID expressed as 32 digits.
Properties
RequestId
Gets the unique request identifier.
public string RequestId { get; }
Property Value
- string
The unique request identifier.
Methods
ToString()
Returns a string that represents this instance.
public override string ToString()