private void CacheInstanceDiscoveryMetadata(string host, InstanceDiscoveryResponse instanceDiscoveryResponse) { foreach (var entry in instanceDiscoveryResponse.Metadata ?? Enumerable.Empty <InstanceDiscoveryMetadataEntry>()) { foreach (string aliasedAuthority in entry.Aliases ?? Enumerable.Empty <string>()) { TryAddValue(aliasedAuthority, entry); } } TryAddValue( host, new InstanceDiscoveryMetadataEntry { PreferredNetwork = host, PreferredCache = host, Aliases = null }); }