Reputation: 138874
I'd like to let people change their subscription filters via an interface in my app. To do this, I need to show them which filters are currently applied to their subscription.
I cannot find anywhere in the documentation where it allows you to list the current filters.
You have the ability to AddRule
and RemoveRule
, but no way to list them. RemoveRule
will even throw an exception if that rule already exists.
How can I determine which rules are currently being applied to my Topic Subscription?
Upvotes: 3
Views: 325
Reputation: 2693
Yes, you can get list of rules for a specific topic and subscription through NamespaceManager.GetRules(string topicPath, string subscriptionName)
:
var rules = namespaceManager.GetRules("MyTopic", "MySubscriber");
foreach (var ruleDescription in rules)
{
Console.Write(ruleDescription.Name);
var filter = ruleDescription.Filter;
}
Upvotes: 2