public static bool CheckRuleGroupHasRules(AcsNamespaceDescription namespaceDesc, string relyingParty, string ruleGroup, int ruleCount) { var acs = new ServiceManagementWrapper(namespaceDesc.Namespace, namespaceDesc.UserName, namespaceDesc.Password); var rules = acs.RetrieveRules(ruleGroup); return (rules != null) && (rules.Count() == ruleCount); }
public static bool CheckRuleGroupHasRule(AcsNamespaceDescription namespaceDesc, string relyingParty, string ruleGroup, string ruleDescription) { var acs = new ServiceManagementWrapper(namespaceDesc.Namespace, namespaceDesc.UserName, namespaceDesc.Password); var rules = acs.RetrieveRules(ruleGroup); return rules.Any(rule => rule.Description.Equals(ruleDescription)); }