Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="5.11.1" />

 ImmutableBucket<TKey, TValue>

class ImmutableBucket<TKey, TValue> : IEnumerable<TValue>, IEnumerable
public static readonly ImmutableBucket<TKey, TValue> Empty

public readonly int Length

public readonly ReadOnlyKeyValue<TKey, TValue>[] Repository

public ImmutableBucket<TKey, TValue> Add(TKey key, TValue value)

public ImmutableBucket<TKey, TValue> AddOrUpdate(TKey key, TValue value, bool byRef, Func<TValue, TValue, TValue> update = null)

public IEnumerator<TValue> GetEnumerator()

public TValue GetOrDefaultByRef(TKey key)

public TValue GetOrDefaultByValue(TKey key)

public ImmutableBucket<TKey, TValue> Remove(TKey key, bool byRef)

public ImmutableBucket<TKey, TValue> ReplaceIfExists(TKey key, Func<TValue, TValue> updateDelegate, bool byRef)

public ImmutableBucket<TKey, TValue> ReplaceIfExists(TKey key, TValue value, bool byRef, Func<TValue, TValue, TValue> update = null)