JsonSerializerContext Class

Definition

Provides metadata about a set of types that is relevant to JSON serialization.

public ref class JsonSerializerContext abstract : System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver
public abstract class JsonSerializerContext : System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver
type JsonSerializerContext = class
    interface IJsonTypeInfoResolver
Public MustInherit Class JsonSerializerContext
Implements IJsonTypeInfoResolver
Inheritance
JsonSerializerContext
Implements

Constructors

JsonSerializerContext(JsonSerializerOptions)

Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.

Properties

GeneratedSerializerOptions

Gets the default run-time options for the context.

Options

Gets the run-time specified options of the context. If no options were passed when instantiating the context, then a new instance is bound and returned.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetTypeInfo(Type)

Gets metadata for the specified type.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IJsonTypeInfoResolver.GetTypeInfo(Type, JsonSerializerOptions)

Resolves a JsonTypeInfo contract for the requested type and options.

Extension Methods

WithAddedModifier(IJsonTypeInfoResolver, Action<JsonTypeInfo>)

Creates a resolver and applies modifications to the metadata generated by the source resolver.

Applies to