CrystalJsonCodec<T>

Namespace: SnowBank.Data.Json.Binary · class

Implements: IValueEncoder<T>, IValueEncoder<T, Slice>

Codec that encodes T instances into either database keys (ordered) or values (unordered)

Constructors

CrystalJsonCodec<T>

CrystalJsonCodec<T>()

Constructs a CrystalJsonCodec using the default behavior

CrystalJsonCodec<T>(CrystalJsonSettings settings = null, ICrystalJsonTypeResolver resolver = null)

Constructs a CrystalJsonCodec using custom settings and resolver

CrystalJsonCodec<T>(IJsonConverter<T> converter, CrystalJsonSettings settings = null, ICrystalJsonTypeResolver resolver = null)

Constructs a CrystalJsonCodec using a custom converter

Properties

Resolver

ICrystalJsonTypeResolver Resolver { get; }

Default JSON type resolver used by this codec

Settings

CrystalJsonSettings Settings { get; }

Default JSON serialization settings used by this codec

Methods

DecodeValue

T DecodeValue(Slice encoded)

EncodeValue

Slice EncodeValue(T value)

Encodes a single value into a compact binary representation

  • value — Value to encode