internal static List <TelemetryItem> Convert(Batch <Activity> batchActivity, string instrumentationKey)
        {
            List <TelemetryItem> telemetryItems = new List <TelemetryItem>();
            TelemetryItem        telemetryItem;

            foreach (var activity in batchActivity)
            {
                MonitorBase telemetryData = new MonitorBase();
                telemetryItem = TelemetryPartA.GetTelemetryItem(activity, instrumentationKey);

                switch (activity.GetTelemetryType())
                {
                case TelemetryType.Request:
                    telemetryData.BaseType = Telemetry_Base_Type_Mapping[TelemetryType.Request];
                    telemetryData.BaseData = TelemetryPartB.GetRequestData(activity);
                    break;

                case TelemetryType.Dependency:
                    telemetryData.BaseType = Telemetry_Base_Type_Mapping[TelemetryType.Dependency];
                    telemetryData.BaseData = TelemetryPartB.GetRemoteDependencyData(activity);
                    break;
                }

                telemetryItem.Data = telemetryData;
                telemetryItems.Add(telemetryItem);
            }

            return(telemetryItems);
        }
        internal static List <TelemetryItem> Convert(Batch <LogRecord> batchLogRecord, string instrumentationKey)
        {
            List <TelemetryItem> telemetryItems = new List <TelemetryItem>();
            TelemetryItem        telemetryItem;

            foreach (var logRecord in batchLogRecord)
            {
                telemetryItem      = TelemetryPartA.GetTelemetryItem(logRecord, instrumentationKey);
                telemetryItem.Data = new MonitorBase
                {
                    BaseType = Telemetry_Base_Type_Mapping[TelemetryType.Message],
                    BaseData = TelemetryPartB.GetMessageData(logRecord),
                };
                telemetryItems.Add(telemetryItem);
            }

            return(telemetryItems);
        }