public static void WriteConnectionOpenError(this DiagnosticListener @this, Guid operationId, SqlConnection sqlConnection, Exception ex, [CallerMemberName] string operation = "")
{
if (@this.IsEnabled(SqlErrorOpenConnection))
{
@this.Write(
SqlErrorOpenConnection,
new
{
OperationId = operationId,
Operation = operation,
ConnectionId = sqlConnection.ClientConnectionId,
Connection = sqlConnection,
Exception = ex,
Timestamp = Stopwatch.GetTimestamp()
});
}
}