void GetEntityData(bool deadLetterQueueData, out long messageCount, out string entityPath) { if (deadLetterQueueData) { if (queueDescription != null) { var queueDescription2 = serviceBusHelper.GetQueue(queueDescription.Path); messageCount = queueDescription2.MessageCountDetails.DeadLetterMessageCount; entityPath = QueueClient.FormatDeadLetterPath(queueDescription.Path); } else { var subscriptionDescription = serviceBusHelper.GetSubscription(subscriptionWrapper.TopicDescription.Path, subscriptionWrapper.SubscriptionDescription.Name); messageCount = subscriptionDescription.MessageCountDetails.DeadLetterMessageCount; entityPath = SubscriptionClient.FormatDeadLetterPath(subscriptionWrapper.SubscriptionDescription.TopicPath, subscriptionWrapper.SubscriptionDescription.Name); } } else { if (queueDescription != null) { var queueDescription2 = serviceBusHelper.GetQueue(queueDescription.Path); messageCount = queueDescription2.MessageCountDetails.ActiveMessageCount; entityPath = queueDescription.Path; } else { var subscriptionDescription = serviceBusHelper.GetSubscription(subscriptionWrapper.TopicDescription.Path, subscriptionWrapper.SubscriptionDescription.Name); messageCount = subscriptionDescription.MessageCountDetails.ActiveMessageCount; entityPath = SubscriptionClient.FormatSubscriptionPath(subscriptionWrapper.SubscriptionDescription.TopicPath, subscriptionWrapper.SubscriptionDescription.Name); } } }