HttpResponseJsonExtensions.WriteAsJsonAsync Methode

Definition

Überlädt

WriteAsJsonAsync(HttpResponse, Object, Type, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

WriteAsJsonAsync(HttpResponse, Object, JsonTypeInfo, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerContext, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonTypeInfo<TValue>, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

WriteAsJsonAsync(HttpResponse, Object, Type, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
Object

Der Wert, der als JSON geschrieben werden soll.

type
Type

Der Typ des zu schreibenden Objekts.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync(HttpResponse, Object, JsonTypeInfo, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo, string? contentType = default, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * System.Text.Json.Serialization.Metadata.JsonTypeInfo * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, jsonTypeInfo As JsonTypeInfo, Optional contentType As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
Object

Der Wert, der als JSON geschrieben werden soll.

jsonTypeInfo
JsonTypeInfo

Metadaten über den zu konvertierenden Typ.

contentType
String

Der Inhaltstyp, der für die Antwort festgelegt werden soll.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
Object

Der Wert, der als JSON geschrieben werden soll.

type
Type

Der Typ des zu schreibenden Objekts.

options
JsonSerializerOptions

Die Serialisierungsoptionen, die beim Serialisieren des Werts verwendet werden sollen.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Text.Json.JsonSerializerOptions? options, string? contentType, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Text.Json.JsonSerializerOptions * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, options As JsonSerializerOptions, contentType As String, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
Object

Der Wert, der als JSON geschrieben werden soll.

type
Type

Der Typ des zu schreibenden Objekts.

options
JsonSerializerOptions

Die Serialisierungsoptionen, die beim Serialisieren des Werts verwendet werden sollen.

contentType
String

Der Inhaltstyp, der für die Antwort festgelegt werden soll.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerContext, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Text.Json.Serialization.JsonSerializerContext context, string? contentType = default, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Text.Json.Serialization.JsonSerializerContext * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, context As JsonSerializerContext, Optional contentType As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
Object

Der Wert, der als JSON geschrieben werden soll.

type
Type

Der Typ des zu schreibenden Objekts.

context
JsonSerializerContext

Ein Metadatenanbieter für serialisierbare Typen.

contentType
String

Der Inhaltstyp, der für die Antwort festgelegt werden soll.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync<TValue>(HttpResponse, TValue, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, Optional cancellationToken As CancellationToken = Nothing) As Task

Typparameter

TValue

Der Typ des zu schreibenden Objekts.

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
TValue

Der Wert, der als JSON geschrieben werden soll.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf application/json; charset=utf-8festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task

Typparameter

TValue

Der Typ des zu schreibenden Objekts.

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
TValue

Der Wert, der als JSON geschrieben werden soll.

options
JsonSerializerOptions

Die Serialisierungsoptionen, die beim Serialisieren des Werts verwendet werden sollen.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Text.Json.JsonSerializerOptions? options, string? contentType, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Text.Json.JsonSerializerOptions * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, options As JsonSerializerOptions, contentType As String, Optional cancellationToken As CancellationToken = Nothing) As Task

Typparameter

TValue

Der Typ des zu schreibenden Objekts.

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
TValue

Der Wert, der als JSON geschrieben werden soll.

options
JsonSerializerOptions

Die Serialisierungsoptionen, die beim Serialisieren des Werts verwendet werden sollen.

contentType
String

Der Inhaltstyp, der für die Antwort festgelegt werden soll.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für:

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonTypeInfo<TValue>, String, CancellationToken)

Schreiben Sie den angegebenen Wert als JSON in den Antworttext. Der Antwortinhaltstyp wird auf den angegebenen Inhaltstyp festgelegt.

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = default, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional contentType As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Typparameter

TValue

Der Typ des zu schreibenden Objekts.

Parameter

response
HttpResponse

Die Antwort, in die JSON geschrieben werden soll.

value
TValue

Der Wert, der als JSON geschrieben werden soll.

jsonTypeInfo
JsonTypeInfo<TValue>

Metadaten zum zu konvertierenden Typ.

contentType
String

Der Inhaltstyp, der für die Antwort festgelegt werden soll.

cancellationToken
CancellationToken

Ein CancellationToken , der zum Abbrechen des Vorgangs verwendet wird.

Gibt zurück

Das Aufgabenobjekt, das den asynchronen Vorgang darstellt.

Gilt für: