Ejemplo n.º 1
0
 public CustomDimensions(CustomDimensions other) : base(other)
 {
     if (!TypesAreMatching <T>())
     {
         throw new TypeLoadException($"{Type.FullName} is not of {typeof(T).FullName}!");
     }
 }
        private void LogTelemetry <TState, TelemetryType>(EventId eventId, TState state, TelemetryType telemetry, Action <TelemetryType> trackTelemetry) where TelemetryType : ITelemetry, ISupportProperties
        {
            CustomDimensions data = new CustomDimensions <TState>(state);

            telemetry.Context.Operation.Id              = eventId.Id.ToString();
            telemetry.Context.Operation.Name            = eventId.Name;
            telemetry.Context.User.Id                   = (state as IUserDetails)?.UserPrincipalName;
            telemetry.Context.Operation.SyntheticSource = _categoryName;

            foreach (var kvp in data)
            {
                telemetry.Properties.Add(kvp);
            }

            trackTelemetry(telemetry);
        }
 /// <summary>
 /// copy constructor
 /// </summary>
 /// <param name="cd"></param>
 public CustomDimensions(CustomDimensions cd)
 {
     CopyAllKeysAndValues(cd);
 }