/// <summary> /// Sets a <paramref name="bucket"/> of values inside current dictionary under provided <paramref name="key"/> /// in the context of the provided cluster <paramref name="node"/>. /// </summary> public ORMultiValueDictionary <TKey, TValue> SetItems(UniqueAddress node, TKey key, IImmutableSet <TValue> bucket) { var newUnderlying = Underlying.AddOrUpdate(node, key, ORSet <TValue> .Empty, _withValueDeltas, old => bucket.Aggregate(old.Clear(node), (set, element) => set.Add(node, element))); return(new ORMultiValueDictionary <TKey, TValue>(newUnderlying, _withValueDeltas)); }
/// <summary> /// Increment the counter with the delta specified. /// If the delta is negative then it will decrement instead of increment. /// </summary> public PNCounterDictionary <TKey> Increment(UniqueAddress node, TKey key, long delta = 1L) => new PNCounterDictionary <TKey>(_underlying.AddOrUpdate(node, key, PNCounter.Empty, old => old.Increment(node, delta)));