TelemetryContext Class
Definition
Object that implements ITelemetryContext.
public class TelemetryContext : ITelemetryContextInheritance object
Implements ITelemetryContext
Constructors
TelemetryContext(IDictionary<string, object>?)
Initializes a new instance of the TelemetryContext class.
public TelemetryContext(IDictionary<string, object>? properties = null)Parameters
properties IDictionary<string, object>
A dictionary of context properties.
Methods
Create(IDictionary<string, T>)
Creates a new instance of the TelemetryContext class.
public static TelemetryContext Create<T>(IDictionary<string, T> properties) where T : classParameters
properties IDictionary<string, T>
A dictionary of context properties.
Returns
TelemetryContext
A new TelemetryContext initialized using a Dictionary of properties.
GetContextProperties()
ITelemetryContext.GetContextProperties object.
public IReadOnlyDictionary<string, object> GetContextProperties()Returns
IReadOnlyDictionary<string, object>
Returns a readonly dictionary of context properties.
AddProperty(string, object)
Add a property to the context.
public void AddProperty(string name, object value)Parameters
name string
The property name.
value object
The property value.
RemoveProperty(string)
Removed a property from the context.
public void RemoveProperty(string name)Parameters
name string
The property name to remove.