# C1.JsonNet.JsonHelper.SerializeObject

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_JsonNet_JsonHelper_SerializeObject_" data-uid="C1.JsonNet.JsonHelper.SerializeObject*">SerializeObject Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_JsonNet_JsonHelper_SerializeObject_" data-uid="C1.JsonNet.JsonHelper.SerializeObject*"></a>
<h4 id="C1_JsonNet_JsonHelper_SerializeObject_System_Object_C1_JsonNet_JsonSetting_" data-uid="C1.JsonNet.JsonHelper.SerializeObject(System.Object,C1.JsonNet.JsonSetting)">SerializeObject(object, JsonSetting)</h4>
<div class="markdown level1 summary"><p>Serializes the specified object to a JSON string using <a class="xref" href="C1.JsonNet.JsonSetting.html">JsonSetting</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string SerializeObject(object obj, JsonSetting js = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(obj As Object, Optional js As JsonSetting = Nothing) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">obj</span></td>
      <td><p>The object to serialize.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.JsonNet.JsonSetting.html">JsonSetting</a></td>
      <td><span class="parametername">js</span></td>
      <td><p>The <a class="xref" href="C1.JsonNet.JsonSetting.html">JsonSetting</a> used to serialize the object.
If this is null, default serialization settings will be used.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>A JSON string representation of the object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_JsonNet_JsonHelper_SerializeObject_" data-uid="C1.JsonNet.JsonHelper.SerializeObject*"></a>
<h4 id="C1_JsonNet_JsonHelper_SerializeObject_System_Object_System_Collections_Generic_IList_C1_JsonNet_JsonConverter__" data-uid="C1.JsonNet.JsonHelper.SerializeObject(System.Object,System.Collections.Generic.IList{C1.JsonNet.JsonConverter})">SerializeObject(object, IList&lt;JsonConverter&gt;)</h4>
<div class="markdown level1 summary"><p>Serializes the specified object to a JSON string using a collection of <a class="xref" href="C1.JsonNet.JsonConverter.html">JsonConverter</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string SerializeObject(object obj, IList&lt;JsonConverter&gt; jsCters)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(obj As Object, jsCters As IList(Of JsonConverter)) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">obj</span></td>
      <td><p>The object to serialize.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a>&lt;<a class="xref" href="C1.JsonNet.JsonConverter.html">JsonConverter</a>&gt;</td>
      <td><span class="parametername">jsCters</span></td>
      <td><p>A collection of <a class="xref" href="C1.JsonNet.JsonConverter.html">JsonConverter</a></p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>A JSON string representation of the object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_JsonNet_JsonHelper_SerializeObject_" data-uid="C1.JsonNet.JsonHelper.SerializeObject*"></a>
<h4 id="C1_JsonNet_JsonHelper_SerializeObject_System_Object_C1_JsonNet_JsonResolver_" data-uid="C1.JsonNet.JsonHelper.SerializeObject(System.Object,C1.JsonNet.JsonResolver)">SerializeObject(object, JsonResolver)</h4>
<div class="markdown level1 summary"><p>Serializes the specified object to a JSON string using <a class="xref" href="C1.JsonNet.JsonResolver.html">JsonResolver</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string SerializeObject(object obj, JsonResolver resolver)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SerializeObject(obj As Object, resolver As JsonResolver) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">obj</span></td>
      <td><p>The object to serialize.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.JsonNet.JsonResolver.html">JsonResolver</a></td>
      <td><span class="parametername">resolver</span></td>
      <td><p>The object of <a class="xref" href="C1.JsonNet.JsonResolver.html">JsonResolver</a></p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>A JSON string representation of the object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
