ProtocolJsonSerializer Class

Definition

Extensions for converting objects to desired types using serialization.

public static class ProtocolJsonSerializer
type ProtocolJsonSerializer = class
Public Module ProtocolJsonSerializer
Inheritance
ProtocolJsonSerializer

Fields

Name Description
ApplicationJson

Properties

Name Description
ChannelIdIncludesProduct

Provides a way to turn off the {channelId}:{product} notation. If false, ChannelId.ToString() is just the {channelId} value. However, serialization of the ProductInfo Entity is still accounted for. ChannelId.SubChannel is still populated with the ProductInfo.Id value in any case. It is not recommended to set false without guidance.

EntityTypes

Maintains a mapping of entity type names to their corresponding Type objects.

SerializationOptions
UnpackObjectStrings

Methods

Name Description
Add(IDictionary<String,JsonElement>, Object)
AddEntityType(String, Type)
AddTypeInfoResolver(IJsonTypeInfoResolver)

Prepends a IJsonTypeInfoResolver (e.g., a source-generated JsonSerializerContext) to the resolver chain used by SerializationOptions. The resolver is consulted before any previously registered resolvers and before the reflection fallback. Call from a SerializationInitAssemblyAttribute-decorated Init() method.

ApplyExtensionConverters(IList<JsonConverter>)
ApplyExtensionOptions(Func<JsonSerializerOptions,JsonSerializerOptions>)

Applies a transformation function to SerializationOptions, replacing it with the result. This is an advanced escape hatch — prefer ApplyExtensionConverters(IList<JsonConverter>) or AddTypeInfoResolver(IJsonTypeInfoResolver) for typical extensions.

CloneTo<T>(Object)
Equals<T>(T, T)
GetAs<ToT,FromT>(FromT)
ToJson(Object)
ToJsonElement(Object)

Object to JsonElement conversion.

ToJsonElements(Object)

Decompose an object into its constituent JSON elements.

ToObject<T>(Object, Func<T>)

Convert an object to the desired type using serialization and deserialization.

Applies to