public static bool CheckRelyingPartyExists(AcsNamespaceDescription namespaceDesc, string relyingPartyName) { var acs = new ServiceManagementWrapper(namespaceDesc.Namespace, namespaceDesc.UserName, namespaceDesc.Password); var relyingParties = acs.RetrieveRelyingParties(); return relyingParties.Any(relyingParty => relyingParty.Name == relyingPartyName); }
public static bool CheckRuleGroupExists(AcsNamespaceDescription namespaceDesc, string relyingParty, string ruleGroup) { var acs = new ServiceManagementWrapper(namespaceDesc.Namespace, namespaceDesc.UserName, namespaceDesc.Password); var relyingParties = acs.RetrieveRelyingParties(); return relyingParties.Where(rp => rp.Name == relyingParty).Select( rp => rp.RelyingPartyRuleGroups.Any(rg => rg.RuleGroup.Name == ruleGroup)).FirstOrDefault(); }