CodeMe.Basics
0.0.4
dotnet add package CodeMe.Basics --version 0.0.4
NuGet\Install-Package CodeMe.Basics -Version 0.0.4
<PackageReference Include="CodeMe.Basics" Version="0.0.4" />
<PackageVersion Include="CodeMe.Basics" Version="0.0.4" />
<PackageReference Include="CodeMe.Basics" />
paket add CodeMe.Basics --version 0.0.4
#r "nuget: CodeMe.Basics, 0.0.4"
#:package CodeMe.Basics@0.0.4
#addin nuget:?package=CodeMe.Basics&version=0.0.4
#tool nuget:?package=CodeMe.Basics&version=0.0.4
CodeMe.Basics
CodeMe.Basics provides small, reusable infrastructure types that complement the BCL.
ScopedAsyncLocal<T>
ScopedAsyncLocal<T> lets you carry ambient context through a logical execution flow without explicitly passing it through every method call. Use ScopedAsyncLocal<T> for values such as request IDs, unit-of-work state, or tenant information. The value is automatically restored when the scope is disposed.
using CodeMe.Threading;
var context = new ScopedAsyncLocal<string>();
using (context.BeginScope("request-1"))
{
Console.WriteLine(context.Current); // request-1
}
Console.WriteLine(context.Current); // null
ScopedAsyncLocal<T> also supports asynchronous flows and nested scopes. For more details and additional examples, see the full documentation:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.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.