/// <summary>
        /// Returns merged cloud states
        /// </summary>
        public SolrCloudState Merge(SolrCloudState state)
        {
            if (state == null || state.Collections == null || !state.Collections.Any())
            {
                return(this);
            }

            foreach (var element in state.Collections)
            {
                Collections.Add(element);
            }

            return(this);
        }
Example #2
0
        public SolrCloudState Merge(SolrCloudState state)
        {
            if (state == null || state.Collections == null || !state.Collections.Any())
            {
                return(this);
            }

            var r = Collections.ToDictionary(kv => kv.Key, kv => kv.Value);

            foreach (var element in state.Collections)
            {
                r.Add(element.Key, element.Value);
            }

            return(new SolrCloudState(r));
        }