/// <summary> /// Gets the receiver message count. /// </summary> /// <returns>Task<EntityMessageCount>.</returns> /// <exception cref="InvalidOperationException">Receiver entity has not been configured</exception> /// <exception cref="System.InvalidOperationException">Receiver entity has not been configured</exception> public async Task <EntityMessageCount> GetReceiverMessageCount() { if (ReceiverInfo == null) { throw new InvalidOperationException("Receiver entity has not been configured"); } if (ReceiverInfo.EntityType == EntityType.Queue) { return(await ManagerClient.GetQueueMessageCount(ReceiverInfo.EntityName)); } else { return(await ManagerClient.GetTopicSubscriptionMessageCount(ReceiverInfo.EntityName, ReceiverInfo.EntitySubscriptionName)); } }