Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlProcessing.OnEndExecuteCallback C# (CSharp) Method

OnEndExecuteCallback() public method

On end callback from Framework event source.
public OnEndExecuteCallback ( long id, bool success, bool synchronous, int sqlExceptionNumber ) : void
id long Identifier of SQL connection object.
success bool Indicate whether operation completed successfully.
synchronous bool Indicates whether operation was called synchronously or asynchronously.
sqlExceptionNumber int SQL exception number.
return void
        public void OnEndExecuteCallback(long id, bool success, bool synchronous, int sqlExceptionNumber)
        {
            DependencyCollectorEventSource.Log.EndCallbackCalled(id.ToString(CultureInfo.InvariantCulture));

            var telemetryTuple = this.TelemetryTable.Get(id);

            if (telemetryTuple == null)
            {
                DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(id.ToString(CultureInfo.InvariantCulture));
                return;
            }

            if (!telemetryTuple.Item2)
            {
                this.TelemetryTable.Remove(id);
                var telemetry = telemetryTuple.Item1 as DependencyTelemetry;
                telemetry.Success = success;
                telemetry.ResultCode = sqlExceptionNumber.ToString(CultureInfo.InvariantCulture);

                ClientServerDependencyTracker.EndTracking(this.telemetryClient, telemetry);
            }
        }