IJsonPackable

Namespace: SnowBank.Data.Json · interface

Supports custom JSON serialization into JsonValue.

Remarks

Types that handle their own custom serialization should typically implement this interface, as well as IJsonSerializable and IJsonDeserializable.

Methods

JsonPack

JsonValue JsonPack(CrystalJsonSettings settings, ICrystalJsonTypeResolver resolver)

Converts an instance of this type into the equivalent JSON value, usually a JSON Object or Array

  • settings — Serialization settings
  • resolver — Custom resolver used to bind the value into a managed type.

If the type also implements , the result of parsing the resulting JSON value should produce an object that is equivalent to the original (or as close as possible if some values loose some precision after serialization)