Exemple #1
0
        internal static void Serialize(MappingBase mappingBase, Dictionary<string, object> fieldDict)
        {
            if (fieldDict == null)
                fieldDict = new Dictionary<string, object>();

            fieldDict.AddObject(_INDEX_KEY, mappingBase.Index.ToString(), mappingBase._INDEX_DEFAULT.ToString());
            fieldDict.AddObject(_STORE_KEY, mappingBase.Store, mappingBase._STORE_DEFAULT);
        }
Exemple #2
0
        internal static void Deserialize(MappingBase mappingBase, Dictionary<string, object> fieldDict)
        {
            if (fieldDict == null || !fieldDict.Any())
                return;

            IndexSettingEnum indexSetting = IndexSettingEnum.No;
            mappingBase.Index = IndexSettingEnum.Find(fieldDict.GetString(_INDEX_KEY, mappingBase._INDEX_DEFAULT.ToString()));

            StoreSettingEnum storeSetting = StoreSettingEnum.No;
            mappingBase.Store = fieldDict.GetBool(_STORE_KEY, mappingBase._STORE_DEFAULT);
        }