Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="4.2.0-preview-685" />

 ImmutableTree<TKey, TValue>

sealed class ImmutableTree<TKey, TValue>
public static readonly ImmutableTree<TKey, TValue> Empty

public readonly bool IsEmpty

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

public ImmutableTree<TKey, TValue> AddOrUpdate(TKey key, TValue value, bool byRef, bool forceUpdate)

public TValue GetOrDefaultByRef(TKey key)

public TValue GetOrDefaultByValue(TKey key)

public ImmutableTree<TKey, TValue> UpdateIfExists(TKey key, bool byRef, Func<TValue, TValue> updateDelegate)

public ImmutableTree<TKey, TValue> UpdateIfExists(TKey key, TValue value, bool byRef)

public IEnumerable<KeyValue<TKey, TValue>> Walk()