DLaB.EarlyBoundGenerator.Settings.EarlyBoundGeneratorConfig.ConvertNonColonDelimitedDictionaryListToDictionaryHash C# (CSharp) Method

ConvertNonColonDelimitedDictionaryListToDictionaryHash() private static method

private static ConvertNonColonDelimitedDictionaryListToDictionaryHash ( string oldValue ) : string
oldValue string
return string
        private static string ConvertNonColonDelimitedDictionaryListToDictionaryHash(string oldValue)
        {
            if (oldValue == null)
            {
                return null;
            }
            var oldValues = Config.GetList<string>(Guid.NewGuid().ToString(), oldValue, new ConfigKeyValueSplitInfo { EntrySeperators = new [] {'|'}});
            var newValues = new Dictionary<string, HashSet<string>>();
            foreach (var entry in oldValues)
            {
                var hash = new HashSet<string>();
                var values = entry.Split(',');
                newValues.Add(values.First(), hash);
                foreach (var value in values.Skip(1).Where(v => !hash.Contains(v)))
                {
                    hash.Add(value);
                }
            }
            return Config.ToString(newValues);
        }