private bool SetupNotification(int attemptsCount, string tableName, NotificationEventHandler changeEventHandler) { bool result = false; string key = NotificationClient.GetKey(tableName, changeEventHandler); NotificationClient notificationClient; while (!_NotificationClients.TryGetValue(key, out notificationClient)) { notificationClient = new NotificationClient() { TableName = tableName, EventHandler = changeEventHandler }; if (AddNotificationClient(notificationClient)) { break; } } result = SetupNotification(notificationClient, attemptsCount); if (!result) { AddNotificationToRepair(notificationClient); } return(result); }