JsonHelperExtensions.Serialize Method

Definition

Returns serialized JSON for the 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

Parameters

jsonHelper
IJsonHelper

The IJsonHelper.

value
Object

The value to serialize as JSON.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

The Newtonsoft.Json.JsonSerializerSettings to be used by the serializer.

Returns

A new IHtmlContent containing the serialized JSON.

Remarks

The value for Newtonsoft.Json.JsonSerializerSettings.StringEscapeHandling from serializerSettings is ignored by this method and Newtonsoft.Json.StringEscapeHandling.EscapeHtml is always used.

Applies to