ApiController.Json ApiController.Json ApiController.Json ApiController.Json Method

Definition

Overloads

Json<T>(T, JsonSerializerSettings, Encoding) Json<T>(T, JsonSerializerSettings, Encoding) Json<T>(T, JsonSerializerSettings, Encoding)

Creates an JsonResult (200 OK) with the specified values.

Json<T>(T, JsonSerializerSettings) Json<T>(T, JsonSerializerSettings) Json<T>(T, JsonSerializerSettings) Json<T>(T, JsonSerializerSettings)

Creates an JsonResult (200 OK) with the specified values.

Json<T>(T) Json<T>(T) Json<T>(T) Json<T>(T)

Creates an JsonResult (200 OK) with the specified value.

Json<T>(T, JsonSerializerSettings, Encoding) Json<T>(T, JsonSerializerSettings, Encoding) Json<T>(T, JsonSerializerSettings, Encoding)

Creates an JsonResult (200 OK) with the specified values.

public:
generic <typename T>
 virtual Microsoft::AspNetCore::Mvc::JsonResult ^ Json(T content, Newtonsoft::Json::JsonSerializerSettings ^ serializerSettings, System::Text::Encoding ^ encoding);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.JsonResult Json<T> (T content, Newtonsoft.Json.JsonSerializerSettings serializerSettings, System.Text.Encoding encoding);
abstract member Json : 'T * Newtonsoft.Json.JsonSerializerSettings * System.Text.Encoding -> Microsoft.AspNetCore.Mvc.JsonResult
override this.Json : 'T * Newtonsoft.Json.JsonSerializerSettings * System.Text.Encoding -> Microsoft.AspNetCore.Mvc.JsonResult

Type Parameters

T

The type of content in the entity body.

Parameters

content

The content value to serialize in the entity body.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings

The serializer settings.

encoding
Encoding Encoding Encoding Encoding

The content encoding.

Returns

A JsonResult with the specified values.

Json<T>(T, JsonSerializerSettings) Json<T>(T, JsonSerializerSettings) Json<T>(T, JsonSerializerSettings) Json<T>(T, JsonSerializerSettings)

Creates an JsonResult (200 OK) with the specified values.

public:
generic <typename T>
 virtual Microsoft::AspNetCore::Mvc::JsonResult ^ Json(T content, Newtonsoft::Json::JsonSerializerSettings ^ serializerSettings);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.JsonResult Json<T> (T content, Newtonsoft.Json.JsonSerializerSettings serializerSettings);
abstract member Json : 'T * Newtonsoft.Json.JsonSerializerSettings -> Microsoft.AspNetCore.Mvc.JsonResult
override this.Json : 'T * Newtonsoft.Json.JsonSerializerSettings -> Microsoft.AspNetCore.Mvc.JsonResult
Public Overridable Function Json(Of T) (content As T, serializerSettings As JsonSerializerSettings) As JsonResult

Type Parameters

T

The type of content in the entity body.

Parameters

content

The content value to serialize in the entity body.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings

The serializer settings.

Returns

A JsonResult with the specified values.

Json<T>(T) Json<T>(T) Json<T>(T) Json<T>(T)

Creates an JsonResult (200 OK) with the specified value.

public:
generic <typename T>
 virtual Microsoft::AspNetCore::Mvc::JsonResult ^ Json(T content);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.JsonResult Json<T> (T content);
abstract member Json : 'T -> Microsoft.AspNetCore.Mvc.JsonResult
override this.Json : 'T -> Microsoft.AspNetCore.Mvc.JsonResult
Public Overridable Function Json(Of T) (content As T) As JsonResult

Type Parameters

T

The type of content in the entity body.

Parameters

content

The content value to serialize in the entity body.

Returns

A JsonResult with the specified value.

Applies to