Class ExecutableContext
- Namespace
- Executables.Context
- Assembly
- executables.dll
Provides access to the current executable context through Current.
public sealed class ExecutableContext : IDisposable, IReadonlyContext, IFormattable
- Inheritance
-
ExecutableContext
- Implements
- Inherited Members
Properties
ContextId
Unique context identifier.
public long ContextId { get; }
Property Value
CorrelationId
Correlation identifier shared by related contexts.
public Guid CorrelationId { get; }
Property Value
Current
Current ambient executable context.
public static IReadonlyContext Current { get; }
Property Value
Depth
Nesting depth relative to the root context.
public int Depth { get; }
Property Value
Name
Context name.
public string Name { get; set; }
Property Value
Parent
Parent context, or null for the root context.
public IReadonlyContext Parent { get; }
Property Value
Root
Root context of the current hierarchy.
public IReadonlyContext Root { get; }
Property Value
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
public string ToString(string format, IFormatProvider formatProvider)
Parameters
formatstringThe format to use.
-or-
A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
TryGetLocal<T>(object, out T)
Tries to get a value from the current context only.
public bool TryGetLocal<T>(object key, out T value)
Parameters
keyobjectvalueT
Returns
Type Parameters
T
TryGet<T>(object, out T)
Tries to get a value from the current context or its ancestors.
public bool TryGet<T>(object key, out T value)
Parameters
keyobjectvalueT
Returns
Type Parameters
T