// 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); }
public void Add(TKey item) { _parent.Add(item, default(TValue)); }