Skip to content

TelemetryContext Class

Definition

Object that implements ITelemetryContext.

C#
public class TelemetryContext : ITelemetryContext

Inheritance object

Implements ITelemetryContext

Constructors

TelemetryContext(IDictionary<string, object>?)

Initializes a new instance of the TelemetryContext class.

C#
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.

C#
public static TelemetryContext Create<T>(IDictionary<string, T> properties) where T : class

Parameters

properties IDictionary<string, T>
A dictionary of context properties.

Returns

TelemetryContext
A new TelemetryContext initialized using a Dictionary of properties.

GetContextProperties()

ITelemetryContext.GetContextProperties object.

C#
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.

C#
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.

C#
public void RemoveProperty(string name)

Parameters

name string
The property name to remove.