次の方法で共有


Microsoft.VisualStudio.RpcContracts.JsonConverters Namespace

Classes

DiscriminatedTypeJsonConverter<TBase>

Allows type hierarchies to be de/serialized by automatically applying, and then reading, an additional json property with a type discriminator value. In addition to the Newtonsoft.Json.JsonConverterAttribute, the base type should also be decorated with one or more TypeDiscriminatorAttribute.

TypeDiscriminatorAttribute

Used with the DiscriminatedTypeJsonConverter<TBase> to define the types in a hierarchy and their associated discriminator value. Apply this to the base type of the type hierarchy, one for each subtype. When the base type is concrete and might also be serialized to JSON, this should also be applied to the base type itself.