/// <summary> /// Deletes a topic/queue entity. /// </summary> /// <param name="entityType">Type of the entity.</param> /// <param name="entityName">Name of the entity to delete.</param> /// <returns>Task.</returns> public async Task DeleteEntity(EntityType entityType, string entityName) { if (entityType == EntityType.Topic) { await ManagerClient.DeleteTopicIfExists(entityName); } else { await ManagerClient.DeleteQueueIfExists(entityName); } }
/// <summary> /// Deletes a topic subscription entity. /// </summary> /// <param name="entityName">Name of the topic entity.</param> /// <returns>Task.</returns> public async Task DeleteEntity(string entityName) { var isTopic = await ManagerClient.IsTopic(entityName); if (isTopic) { await ManagerClient.DeleteTopicIfExists(entityName); } else { await ManagerClient.DeleteQueueIfExists(entityName); } }
/// <summary>Scotches the namespace by deleting all topics and queues.</summary> public async Task ScotchNamespace() { var topics = await ManagerClient.GetTopicsAsync(); var queues = await ManagerClient.GetQueuesAsync(); foreach (var topic in topics) { await ManagerClient.DeleteTopicIfExists(topic.Path); } foreach (var queue in queues) { await ManagerClient.DeleteQueueIfExists(queue.Path); } }