Share via


TypedResults.Json 메서드

정의

오버로드

Json<TValue>(TValue, JsonSerializerOptions, String, Nullable<Int32>)

지정된 개체를 JsonHttpResult<TValue> JSON으로 직렬화하는 을 data 만듭니다.

Json<TValue>(TValue, JsonSerializerContext, String, Nullable<Int32>)

지정된 개체를 JsonHttpResult<TValue> JSON으로 직렬화하는 을 data 만듭니다.

Json<TValue>(TValue, JsonTypeInfo<TValue>, String, Nullable<Int32>)

지정된 개체를 JsonHttpResult<TValue> JSON으로 직렬화하는 을 data 만듭니다.

Json<TValue>(TValue, JsonSerializerOptions, String, Nullable<Int32>)

지정된 개체를 JsonHttpResult<TValue> JSON으로 직렬화하는 을 data 만듭니다.

public static Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<TValue> Json<TValue> (TValue? data, System.Text.Json.JsonSerializerOptions? options = default, string? contentType = default, int? statusCode = default);
static member Json : 'Value * System.Text.Json.JsonSerializerOptions * string * Nullable<int> -> Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<'Value>
Public Shared Function Json(Of TValue) (data As TValue, Optional options As JsonSerializerOptions = Nothing, Optional contentType As String = Nothing, Optional statusCode As Nullable(Of Integer) = Nothing) As JsonHttpResult(Of TValue)

형식 매개 변수

TValue

JSON이 응답 본문으로 직렬화될 개체의 형식입니다.

매개 변수

data
TValue

JSON으로 쓸 개체입니다.

options
JsonSerializerOptions

값을 serialize할 때 사용할 serializer 옵션입니다.

contentType
String

응답에 설정할 콘텐츠 형식입니다.

statusCode
Nullable<Int32>

응답에 설정할 상태 코드입니다.

반환

JsonHttpResult<TValue> 지정된 를 응답에 data 대한 JSON 형식으로 직렬화하는 입니다.

설명

호출자는 각 호출을 통해 캐시된 데이터를 다시 생성하지 않도록 직렬 변환기 설정의 instance 캐시해야 합니다.

적용 대상

Json<TValue>(TValue, JsonSerializerContext, String, Nullable<Int32>)

지정된 개체를 JsonHttpResult<TValue> JSON으로 직렬화하는 을 data 만듭니다.

public static Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<TValue> Json<TValue> (TValue? data, System.Text.Json.Serialization.JsonSerializerContext context, string? contentType = default, int? statusCode = default);
static member Json : 'Value * System.Text.Json.Serialization.JsonSerializerContext * string * Nullable<int> -> Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<'Value>
Public Shared Function Json(Of TValue) (data As TValue, context As JsonSerializerContext, Optional contentType As String = Nothing, Optional statusCode As Nullable(Of Integer) = Nothing) As JsonHttpResult(Of TValue)

형식 매개 변수

TValue

JSON이 응답 본문으로 직렬화될 개체의 형식입니다.

매개 변수

data
TValue

JSON으로 쓸 개체입니다.

context
JsonSerializerContext

직렬화 가능한 형식에 대한 메타데이터 공급자입니다.

contentType
String

응답에 설정할 콘텐츠 형식입니다.

statusCode
Nullable<Int32>

응답에 설정할 상태 코드입니다.

반환

JsonHttpResult<TValue> 지정된 를 응답에 data 대한 JSON 형식으로 직렬화하는 입니다.

적용 대상

Json<TValue>(TValue, JsonTypeInfo<TValue>, String, Nullable<Int32>)

지정된 개체를 JsonHttpResult<TValue> JSON으로 직렬화하는 을 data 만듭니다.

public static Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<TValue> Json<TValue> (TValue? data, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = default, int? statusCode = default);
static member Json : 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * string * Nullable<int> -> Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<'Value>
Public Shared Function Json(Of TValue) (data As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional contentType As String = Nothing, Optional statusCode As Nullable(Of Integer) = Nothing) As JsonHttpResult(Of TValue)

형식 매개 변수

TValue

JSON이 응답 본문으로 직렬화될 개체의 형식입니다.

매개 변수

data
TValue

JSON으로 쓸 개체입니다.

jsonTypeInfo
JsonTypeInfo<TValue>

변환할 형식에 대한 메타데이터입니다.

contentType
String

응답에 설정할 콘텐츠 형식입니다.

statusCode
Nullable<Int32>

응답에 설정할 상태 코드입니다.

반환

JsonHttpResult<TValue> 지정된 를 응답에 data 대한 JSON 형식으로 직렬화하는 입니다.

적용 대상