Share via


ApiController.Json Method

Definition

Overloads

Json<T>(T, JsonSerializerSettings, Encoding)

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

Json<T>(T, JsonSerializerSettings)

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

Json<T>(T)

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

Json<T>(T, JsonSerializerSettings, Encoding)

Source:
ApiController.cs
Source:
ApiController.cs

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

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.JsonResult Json<T> (T content, Newtonsoft.Json.JsonSerializerSettings serializerSettings, System.Text.Encoding encoding);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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
Public Overridable Function Json(Of T) (content As T, serializerSettings As JsonSerializerSettings, encoding As Encoding) As JsonResult

Type Parameters

T

The type of content in the entity body.

Parameters

content
T

The content value to serialize in the entity body.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

The serializer settings.

encoding
Encoding

The content encoding.

Returns

A JsonResult with the specified values.

Attributes

Applies to

Json<T>(T, JsonSerializerSettings)

Source:
ApiController.cs
Source:
ApiController.cs

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

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.JsonResult Json<T> (T content, Newtonsoft.Json.JsonSerializerSettings serializerSettings);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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
T

The content value to serialize in the entity body.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

The serializer settings.

Returns

A JsonResult with the specified values.

Attributes

Applies to

Json<T>(T)

Source:
ApiController.cs
Source:
ApiController.cs

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

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.JsonResult Json<T> (T content);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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
T

The content value to serialize in the entity body.

Returns

A JsonResult with the specified value.

Attributes

Applies to