JsonHelperExtensions.Serialize 方法

定义

返回 的 value序列化 JSON。

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

参数

jsonHelper
IJsonHelper

IJsonHelper

value
Object

要序列化为 JSON 的值。

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

Newtonsoft.Json.JsonSerializerSettings序列化程序要使用的 。

返回

包含序列化 JSON 的新 IHtmlContent

注解

此方法将忽略 的 值Newtonsoft.Json.JsonSerializerSettings.StringEscapeHandlingserializerSettings,并且Newtonsoft.Json.StringEscapeHandling.EscapeHtml始终使用 。

适用于