Stashbox by Peter Csajtai

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

 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, Func<TValue, TValue, TValue> updateDelegate = null)

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

public TValue GetOrDefault(TKey key)

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

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

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