JsonSerializerContext(JsonSerializerOptions) 构造函数

定义

创建一个实例并将其绑定到所指示JsonSerializerOptions的实例JsonSerializerContext

protected:
 JsonSerializerContext(System::Text::Json::JsonSerializerOptions ^ options);
protected JsonSerializerContext(System.Text.Json.JsonSerializerOptions? options);
new System.Text.Json.Serialization.JsonSerializerContext : System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.JsonSerializerContext
Protected Sub New (options As JsonSerializerOptions)

参数

options
JsonSerializerOptions

运行时为上下文实例提供了选项。

注解

如果未传递实例选项,则在上下文使用或AddContext<TContext>()Options调用上下文之前,不会设置任何选项,其中会创建并绑定新的选项实例。

适用于