<PackageReference Include="OpenTelemetry.Api" Version="1.16.0" />

OpenTelemetry.Context.RuntimeContextSlot<T>

public abstract class RuntimeContextSlot<T> : IDisposable
The abstract context slot.
public string Name { get; }

Gets the name of the context slot.

protected RuntimeContextSlot(string name)

Initializes a new instance of the RuntimeContextSlot<T> class.

public void Dispose()

protected virtual void Dispose(bool disposing)

Releases the unmanaged resources used by this class and optionally releases the managed resources.

public abstract T Get()

Get the value from the context slot.

public abstract void Set(T value)

Set the value to the context slot.