[]
        
(Showing Draft Content)

C1.JsonNet.JsonHelper.SerializeObject

SerializeObject Method

SerializeObject(object, JsonSetting)

Serializes the specified object to a JSON string using JsonSetting.

Declaration
public static string SerializeObject(object obj, JsonSetting js = null)
Public Shared Function SerializeObject(obj As Object, Optional js As JsonSetting = Nothing) As String
Parameters
Type Name Description
object obj

The object to serialize.

JsonSetting js

The JsonSetting used to serialize the object. If this is null, default serialization settings will be used.

Returns
Type Description
string

A JSON string representation of the object.

SerializeObject(object, IList<JsonConverter>)

Serializes the specified object to a JSON string using a collection of JsonConverter.

Declaration
public static string SerializeObject(object obj, IList<JsonConverter> jsCters)
Public Shared Function SerializeObject(obj As Object, jsCters As IList(Of JsonConverter)) As String
Parameters
Type Name Description
object obj

The object to serialize.

IList<JsonConverter> jsCters

A collection of JsonConverter

Returns
Type Description
string

A JSON string representation of the object.

SerializeObject(object, JsonResolver)

Serializes the specified object to a JSON string using JsonResolver.

Declaration
public static string SerializeObject(object obj, JsonResolver resolver)
Public Shared Function SerializeObject(obj As Object, resolver As JsonResolver) As String
Parameters
Type Name Description
object obj

The object to serialize.

JsonResolver resolver

The object of JsonResolver

Returns
Type Description
string

A JSON string representation of the object.