Compartir a través de


JsonHelperExtensions.Serialize Método

Definición

Devuelve JSON serializado para value.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ Serialize(Microsoft::AspNetCore::Mvc::Rendering::IJsonHelper ^ jsonHelper, System::Object ^ value, Newtonsoft::Json::JsonSerializerSettings ^ serializerSettings);
public static Microsoft.AspNetCore.Html.IHtmlContent Serialize (this Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper jsonHelper, object value, Newtonsoft.Json.JsonSerializerSettings serializerSettings);
static member Serialize : Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper * obj * Newtonsoft.Json.JsonSerializerSettings -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function Serialize (jsonHelper As IJsonHelper, value As Object, serializerSettings As JsonSerializerSettings) As IHtmlContent

Parámetros

jsonHelper
IJsonHelper

IJsonHelper.

value
Object

Valor que se va a serializar como JSON.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

que Newtonsoft.Json.JsonSerializerSettings va a usar el serializador.

Devoluciones

Nuevo IHtmlContent que contiene el JSON serializado.

Comentarios

Este método Newtonsoft.Json.StringEscapeHandling.EscapeHtml omite el valor Newtonsoft.Json.JsonSerializerSettings.StringEscapeHandling de de y serializerSettings siempre se usa.

Se aplica a