Esempio n. 1
0
        // ReSharper disable once UnusedMember.Global
        public static void DoSave(IWriterCtx ctx, IDictionary <TKey, TValue>?dictionary, int cfgId)
        {
            var writerCtx = (IDBWriterCtx)ctx;

            if (!(dictionary is ODBDictionary <TKey, TValue> goodDict))
            {
                var tr = writerCtx.GetTransaction();
                var id = tr.AllocateDictionaryId();
                goodDict = new ODBDictionary <TKey, TValue>(tr, (ODBDictionaryConfiguration)writerCtx.FindInstance(cfgId), id);
                if (dictionary != null)
                {
                    foreach (var pair in dictionary)
                    {
                        goodDict.Add(pair.Key, pair.Value);
                    }
                }
            }
            ctx.Writer().WriteVUInt64(goodDict._id);
        }
Esempio n. 2
0
 public void Add(TKey item)
 {
     _parent.Add(item, default(TValue));
 }