SaanSoft.CorrelationId 1.1.2

dotnet add package SaanSoft.CorrelationId --version 1.1.2                
NuGet\Install-Package SaanSoft.CorrelationId -Version 1.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SaanSoft.CorrelationId" Version="1.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SaanSoft.CorrelationId --version 1.1.2                
#r "nuget: SaanSoft.CorrelationId, 1.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SaanSoft.CorrelationId as a Cake Addin
#addin nuget:?package=SaanSoft.CorrelationId&version=1.1.2

// Install SaanSoft.CorrelationId as a Cake Tool
#tool nuget:?package=SaanSoft.CorrelationId&version=1.1.2                

SaanSoft.CorrelationId

In a distributed system it can be a challenge to trace HTTP requests and messages through multiple microservices.

A CorrelationId is metadata than can be used to bundle each logical transaction as it moves through multiple processors.

With this system, your client's requests are collected under one value for easier tracking and troubleshooting.

Register in IoC

ICorrelationIdProvider should be registered at the request scope level, as it should be use the same object across all calls for a HTTP request or logical transaction.

IServiceCollection

For api and web projects using the normal AddScoped function is perfect.

serviceCollection.AddScoped<ICorrelationIdProvider, CorrelationIdProvider>();

Usage

Pass ICorrelationIdProvider into the class's constructor, then call correlationIdProvider.Get() to retrieve the CorrelationId for the current request.

Dependencies

CorrelationIdProvider can be used by itself, and it will provide a unique string for each request.

However, you can also setup CorrelationIdProvider to use values from other sources such as HTTP request header by using other dependencies and middleware.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 91 9/8/2024
1.1.1 83 9/8/2024
1.1.0 99 9/7/2024
1.0.4 94 9/7/2024