NewtonsoftJsonOutputFormatter 类

定义

TextOutputFormatter JSON 内容的 。

public ref class NewtonsoftJsonOutputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextOutputFormatter
public class NewtonsoftJsonOutputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextOutputFormatter
type NewtonsoftJsonOutputFormatter = class
    inherit TextOutputFormatter
Public Class NewtonsoftJsonOutputFormatter
Inherits TextOutputFormatter
继承
NewtonsoftJsonOutputFormatter

构造函数

NewtonsoftJsonOutputFormatter(JsonSerializerSettings, ArrayPool<Char>, MvcOptions)
已过时.

初始化一个新 NewtonsoftJsonOutputFormatter 实例。

NewtonsoftJsonOutputFormatter(JsonSerializerSettings, ArrayPool<Char>, MvcOptions, MvcNewtonsoftJsonOptions)

初始化一个新 NewtonsoftJsonOutputFormatter 实例。

属性

SerializerSettings

获取 Newtonsoft.Json.JsonSerializerSettings 用于配置 的 Newtonsoft.Json.JsonSerializer

SupportedEncodings

获取此 TextOutputFormatter支持的字符编码的可变集合。 写入数据时使用编码。

(继承自 TextOutputFormatter)
SupportedMediaTypes

获取此 OutputFormatter支持的媒体类型元素的可变集合。

(继承自 OutputFormatter)

方法

CanWriteResult(OutputFormatterCanWriteContext)

确定这 IOutputFormatter 是否可以序列化指定类型的对象。

(继承自 OutputFormatter)
CanWriteType(Type)

返回一个值,该值指示此序列化程序是否可以写入给定类型。

(继承自 OutputFormatter)
CreateJsonSerializer()

在序列化期间调用以创建 Newtonsoft.Json.JsonSerializer。通过传递的格式化程序上下文,可以创建特定于上下文的序列化程序。

CreateJsonSerializer(OutputFormatterWriteContext)

在序列化期间调用以创建 Newtonsoft.Json.JsonSerializer。通过传递的格式化程序上下文,可以创建特定于上下文的序列化程序。

CreateJsonWriter(TextWriter)

在序列化期间调用以创建 Newtonsoft.Json.JsonWriter

GetSupportedContentTypes(String, Type)

获取 和 contentType支持的内容类型IOutputFormatterobjectType的筛选列表。

(继承自 OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

根据提供的内容类型,确定用于读取或写入 HTTP 实体正文的受支持编码中的最佳 Encoding 类型。

(继承自 TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

写入由 context的 Object 属性表示的对象。

(继承自 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext)

写入响应正文。

(继承自 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

写入响应正文。

WriteResponseHeaders(OutputFormatterWriteContext)

设置 对象上的 HttpResponse 标头。

(继承自 OutputFormatter)

适用于