/// <summary> /// Add data model common properties to telemetry events. /// </summary> private void InitDataModelBasicProperties() { ReservedProperties["DataModel.Source"] = "DataModelApi"; ReservedProperties["DataModel.EntityType"] = DataModelEventTypeNames.GetName(EventType); ReservedProperties["DataModel.EntitySchemaVersion"] = EventSchemaVersion; ReservedProperties["DataModel.CorrelationId"] = Correlation.Id; }
private IEnumerable <KeyValuePair <string, object> > GetCorrelatedWithProperties() { if (CorrelatedWith != null && CorrelatedWith.Any()) { int index = 0; foreach (KeyValuePair <TelemetryEventCorrelation, string> item in CorrelatedWith) { index++; string value = StringExtensions.Join((IEnumerable <string>) new string[3] { item.Key.Id.ToString("D"), DataModelEventTypeNames.GetName(item.Key.EventType), item.Value ?? string.Empty }, ","); yield return(new KeyValuePair <string, object>("DataModel.Correlation." + index.ToString(), value)); } } }