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)); }
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); }