ProtocolJsonSerializer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 |
| 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) | |
| RegisterActivityTypeResolver(ActivityTypeResolver) |
Registers an imperative ActivityTypeResolver for custom Activity resolution
scenarios that the declarative ActivityTypeAttribute discriminators cannot
express. The resolver receives a private Utf8JsonReader copy positioned at
the Activity's |
| RegisterActivityTypes(IEnumerable<Type>) |
Registers custom Activity subclasses for polymorphic deserialization.
Each type must derive from Activity and be annotated with one or more
ActivityTypeAttribute. Each attribute declares the discriminators
( |
| 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. |