IJsonReadOnlyConverter<TValue, TReadOnlyProxy>

Namespace: SnowBank.Data.Json · interface

Implements: IJsonConverter<TValue>, IJsonConverter, IJsonSerializer<TValue>, IJsonDeserializer<TValue>, IJsonPacker<TValue>

Bundle interface that is implemented by source-generated encoders for read-only proxies.

Methods

ToReadOnly

TReadOnlyProxy ToReadOnly(JsonValue value)

Wraps the specified JSON value into a read-only proxy

  • value — Underlying JSON value

Returns: Proxy that exposes the value using typed properties.

TReadOnlyProxy ToReadOnly(TValue instance)

Wraps a TValue instance with a read-only proxy

  • instance — Instance that will be converted to JSON

Returns: Proxy that exposes the equivalent JSON value, using typed properties.

TReadOnlyProxy ToReadOnly(IObservableJsonContext context, JsonValue value)

Wraps the specified JSON value into a read-only proxy

  • context — Context that will record all access to the read-only proxy
  • value — Underlying JSON value

Returns: Proxy that exposes the value using typed properties.

TReadOnlyProxy ToReadOnly(IObservableJsonContext context, TValue instance)

Wraps a TValue instance with a read-only proxy

  • context — Context that will record all access to the read-only proxy
  • instance — Instance that will be converted to JSON

Returns: Proxy that exposes the equivalent JSON value, using typed properties.