Namespace Eco.Shared.Collections
Classes
ImmutableDictionaryTransaction<TKey, TValue>
It is a class for transaction for System.Collections.Immutable.ImmutableDictionary<, >. It isn't immutable by itself. It is also not thread-safe and can be used from one thread. It provides more effective way to make multiple modifications for System.Collections.Immutable.ImmutableDictionary<, > in transaction with tracking for all changes. It behaves dictionary-like and implements most common dictionary methods. You should use this class if you want to make multiple modifications to ThreadSafeDictionary<TKey, TValue>, but don't wanna to make them visible until all of them completed. You should ensure no other modifications done in ThreadSafeDictionary<TKey, TValue> until transaction complete, because they may be overwritten. Then you can create/re-use ImmutableDictionaryTransaction<TKey, TValue> and Start(ImmutableDictionary<TKey, TValue>) it for Snapshot. When you done you can Commit() it and get new System.Collections.Immutable.ImmutableDictionary<, > with all modifications applied and then Set(ImmutableDictionary<TKey, TValue>) it back. It may be extended if required to expose all modifications done in transaction for processing.