@@ -24,7 +24,7 @@ public static void TrackEvent(this TelemetryClient telemetryClient, string event
24
24
properties = new Dictionary < string , string > ( ) ;
25
25
}
26
26
27
- AddTargetingProperties ( properties , targetingContext ) ;
27
+ properties [ "TargetingId" ] = targetingContext . UserId ;
28
28
29
29
telemetryClient . TrackEvent ( eventName , properties , metrics ) ;
30
30
}
@@ -41,45 +41,11 @@ public static void TrackEvent(this TelemetryClient telemetryClient, EventTelemet
41
41
telemetry = new EventTelemetry ( ) ;
42
42
}
43
43
44
- AddTargetingProperties ( telemetry . Properties , targetingContext ) ;
44
+ telemetry . Properties [ "TargetingId" ] = targetingContext . UserId ;
45
45
46
46
telemetryClient . TrackEvent ( telemetry ) ;
47
47
}
48
48
49
- /// <summary>
50
- /// Extension method to track a metric with <see cref="TargetingContext"/>.
51
- /// </summary>
52
- public static void TrackMetric ( this TelemetryClient telemetryClient , string name , double value , TargetingContext targetingContext , IDictionary < string , string > properties = null )
53
- {
54
- ValidateTargetingContext ( targetingContext ) ;
55
-
56
- if ( properties == null )
57
- {
58
- properties = new Dictionary < string , string > ( ) ;
59
- }
60
-
61
- AddTargetingProperties ( properties , targetingContext ) ;
62
-
63
- telemetryClient . TrackMetric ( name , value , properties ) ;
64
- }
65
-
66
- /// <summary>
67
- /// Extension method to track a <see cref="MetricTelemetry"/> with <see cref="TargetingContext"/>.
68
- /// </summary>
69
- public static void TrackMetric ( this TelemetryClient telemetryClient , MetricTelemetry telemetry , TargetingContext targetingContext )
70
- {
71
- ValidateTargetingContext ( targetingContext ) ;
72
-
73
- if ( telemetry == null )
74
- {
75
- telemetry = new MetricTelemetry ( ) ;
76
- }
77
-
78
- AddTargetingProperties ( telemetry . Properties , targetingContext ) ;
79
-
80
- telemetryClient . TrackMetric ( telemetry ) ;
81
- }
82
-
83
49
private static void ValidateTargetingContext ( TargetingContext targetingContext )
84
50
{
85
51
if ( targetingContext == null )
@@ -90,7 +56,6 @@ private static void ValidateTargetingContext(TargetingContext targetingContext)
90
56
91
57
private static void AddTargetingProperties ( IDictionary < string , string > properties , TargetingContext targetingContext )
92
58
{
93
- properties [ "TargetingId" ] = targetingContext . UserId ;
94
59
}
95
60
}
96
61
}
0 commit comments