public Uri FindSiteBaseUriForManfiestElement(Dictionary <SupportServiceIdentity, Uri> sites, SupportServiceResourceKey key)
        {
            if (sites == null)
            {
                throw new ArgumentNullException(nameof(sites));
            }
            SiteResource resource = null;
            KeyValuePair <SupportServiceIdentity, Uri> site;

            foreach (var item in this)
            {
                if (item.Challenges.Any(c => c.ChallengeKey == key))
                {
                    site = sites.FirstOrDefault(x => x.Key == item.Challenges.First(y => y.ChallengeKey == key).ServiceIdentity);
                    return(site.Value);
                }

                if (item.Resources.Any(c => c.ResourceKey == key))
                {
                    site = sites.FirstOrDefault(x => x.Key == item.Resources.First(y => y.ResourceKey == key).ServiceIdentity);
                    return(site.Value);
                }
            }

            return(null);
        }
 public SiteManifest ManifestFromResource(SiteResource resource)
 {
     foreach (var manifest in this)
     {
         if (manifest.Resources.Any(item => item.ResourceKey == resource.ResourceKey))
         {
             return(manifest);
         }
     }
     return(null);
 }