IJsonReadOnlyProxy<TValue, TReadOnlyProxy, TWritableProxy>

Namespace: SnowBank.Data.Json · interface

Implements: IJsonReadOnlyProxy<TValue, TReadOnlyProxy>, IJsonReadOnlyProxy<TValue>, IJsonReadOnlyProxy, IJsonSerializable, IJsonPackable, IEquatable<JsonValue>, IEquatable<ObservableJsonValue>

Wraps a JsonValue into typed read-only proxy that emulates the type TValue with support for copy-on-write.

Remarks

This interface is a marker for "wrapper types" that replicate the same set of properties and fields as TValue, using a wrapped JsonValue as source.

Methods

ToMutable

TWritableProxy ToMutable()

Returns a mutable proxy that is able to mutate a copy of the wrapped JSON value

With

TReadOnlyProxy With(Action<TWritableProxy> modifier)

Returns an updated read-only version of this proxy, after applying a set of mutations.

  • modifier — Handler that is passed a mutable copy of the object, which will be frozen into a new read-only object after the handler returns.

Returns: Updated read-only instance

The original read-only object will NOT be modified.