JsonOutputFormatter Classe

Définition

pour TextOutputFormatter le contenu JSON.

public ref class JsonOutputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextOutputFormatter
public class JsonOutputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextOutputFormatter
type JsonOutputFormatter = class
    inherit TextOutputFormatter
Public Class JsonOutputFormatter
Inherits TextOutputFormatter
Héritage

Constructeurs

JsonOutputFormatter(JsonSerializerSettings, ArrayPool<Char>)

Initialise une nouvelle instance de JsonOutputFormatter.

Propriétés

PublicSerializerSettings

Obtient le Newtonsoft.Json.JsonSerializerSettings utilisé pour configurer le Newtonsoft.Json.JsonSerializer.

SerializerSettings

Obtient le Newtonsoft.Json.JsonSerializerSettings utilisé pour configurer le Newtonsoft.Json.JsonSerializer.

SupportedEncodings

Obtient la collection mutable d’encodages de caractères pris en charge par ce TextOutputFormatter. Les encodages sont utilisés lors de l’écriture des données.

(Hérité de TextOutputFormatter)
SupportedMediaTypes

Obtient la collection mutable d’éléments de type multimédia pris en charge par ce OutputFormatter.

(Hérité de OutputFormatter)

Méthodes

CanWriteResult(OutputFormatterCanWriteContext)

Détermine si cela IOutputFormatter peut sérialiser un objet du type spécifié.

(Hérité de OutputFormatter)
CanWriteType(Type)

Retourne une valeur indiquant si le type donné peut ou non être écrit par ce sérialiseur.

(Hérité de OutputFormatter)
CreateJsonSerializer()

Appelé pendant la sérialisation pour créer le Newtonsoft.Json.JsonSerializer.

CreateJsonWriter(TextWriter)

Appelé pendant la sérialisation pour créer le Newtonsoft.Json.JsonWriter.

GetSupportedContentTypes(String, Type)

Obtient une liste filtrée des types de contenu pris en charge par le IOutputFormatter pour et objectTypecontentType.

(Hérité de OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

Détermine le meilleur Encoding parmi les encodages pris en charge pour la lecture ou l’écriture d’un corps d’entité HTTP en fonction du type de contenu fourni.

(Hérité de TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

Écrit l’objet représenté par contextla propriété Object de .

(Hérité de TextOutputFormatter)
WriteObject(TextWriter, Object)

Écrit le donné value au format JSON à l’aide du donné writer.

WriteResponseBodyAsync(OutputFormatterWriteContext)

Écrit le corps de la réponse.

(Hérité de TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

Écrit le corps de la réponse.

WriteResponseHeaders(OutputFormatterWriteContext)

Définit les en-têtes sur l’objet HttpResponse .

(Hérité de OutputFormatter)

S’applique à