共用方式為


EventData.Properties Property

Definition

The set of free-form properties which may be used for associating metadata with the event that is meaningful within the application context.

public System.Collections.Generic.IDictionary<string,object> Properties { get; }
member this.Properties : System.Collections.Generic.IDictionary<string, obj>
Public ReadOnly Property Properties As IDictionary(Of String, Object)

Property Value

Exceptions

Occurs when the EventData is serialized for transport when an unsupported type is used as a property.

Examples

var eventData = new EventData(serializedTelemetryData);
eventData.Properties["eventType"] = "com.microsoft.azure.monitoring.EtlEvent";

Remarks

A common use case for Properties is to associate serialization hints for the EventBody as an aid to consumers who wish to deserialize the binary data when the ContentType alone does not offer sufficient context.

The following types are supported:

  • string
  • bool
  • byte
  • sbyte
  • short
  • ushort
  • int
  • uint
  • long
  • ulong
  • float
  • decimal
  • double
  • char
  • Guid
  • DateTime
  • DateTimeOffset
  • Stream
  • Uri
  • TimeSpan
  • byte[]

Applies to