Esempio n. 1
0
        private static IStrictEnumerable <Key> ParseKeys(IDictionary <string, JToken> jsonDocument, bool includeMetadata)
        {
            var keyNames = jsonDocument.Keys.Distinct(KeyName);
            var keys     = keyNames.Select(name => CreateKey(name, jsonDocument, includeMetadata));

            return(StrictEnumerable.Create(keys));
        }
Esempio n. 2
0
        public static IStrictEnumerable <Error> Validate(InputLocalizationData localData, VersionedLocalizationData storageData, string defaultLanguage, bool allowKeyRemoval)
        {
            var defaultLanguageLocalData = localData.Data.Single(p => p.Key.Code.SafeEquals(defaultLanguage)).Value;
            var keyRemovalErrors         = allowKeyRemoval.Match(
                t => StrictEnumerable.Empty <Error>(),
                f => CheckKeyRemovals(defaultLanguageLocalData, storageData)
                );

            return(keyRemovalErrors);
        }