System.Data.SqlClient.SqlClientDiagnosticListenerExtensions.WriteConnectionCloseError C# (CSharp) Method

WriteConnectionCloseError() public static method

public static WriteConnectionCloseError ( this @this, Guid operationId, Guid clientConnectionId, SqlConnection sqlConnection, Exception ex, [ operation = "" ) : void
@this this
operationId Guid
clientConnectionId Guid
sqlConnection SqlConnection
ex Exception
operation [
return void
        public static void WriteConnectionCloseError(this DiagnosticListener @this, Guid operationId, Guid clientConnectionId, SqlConnection sqlConnection, Exception ex, [CallerMemberName] string operation = "")
        {
            if (@this.IsEnabled(SqlErrorCloseConnection))
            {
                @this.Write(
                    SqlErrorCloseConnection,
                    new
                    {
                        OperationId = operationId,
                        Operation = operation,
                        ConnectionId = clientConnectionId,
                        Connection = sqlConnection,
                        Statistics = sqlConnection.Statistics?.GetDictionary(),
                        Exception = ex,
                        Timestamp = Stopwatch.GetTimestamp()
                    });
            }
        }