# C1.Web.Mvc.Serialization.JsonConvertHelper.C1Json

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Web_Mvc_Serialization_JsonConvertHelper_C1Json_" data-uid="C1.Web.Mvc.Serialization.JsonConvertHelper.C1Json*">C1Json Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Web_Mvc_Serialization_JsonConvertHelper_C1Json_" data-uid="C1.Web.Mvc.Serialization.JsonConvertHelper.C1Json*"></a>
<h4 id="C1_Web_Mvc_Serialization_JsonConvertHelper_C1Json_System_Web_Mvc_Controller_System_Object_System_String_System_Text_Encoding_System_Web_Mvc_JsonRequestBehavior_System_Boolean_" data-uid="C1.Web.Mvc.Serialization.JsonConvertHelper.C1Json(System.Web.Mvc.Controller,System.Object,System.String,System.Text.Encoding,System.Web.Mvc.JsonRequestBehavior,System.Boolean)">C1Json(Controller, object, string, Encoding, JsonRequestBehavior, bool)</h4>
<div class="markdown level1 summary"><p>Serialize data to json for C1 data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static JsonResult C1Json(this Controller controller, object data, string contentType = null, Encoding contentEncoding = null, JsonRequestBehavior behavior = 1, bool useCamelCasePropertyName = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function C1Json(controller As Controller, data As Object, Optional contentType As String = Nothing, Optional contentEncoding As Encoding = Nothing, Optional behavior As JsonRequestBehavior = 1, Optional useCamelCasePropertyName As Boolean = True) As JsonResult</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><span class="xref">Controller</span></td>
      <td><span class="parametername">controller</span></td>
      <td><p>The controller</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">data</span></td>
      <td><p>The data</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">contentType</span></td>
      <td><p>The content type</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.encoding">Encoding</a></td>
      <td><span class="parametername">contentEncoding</span></td>
      <td><p>The content encoding</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">JsonRequestBehavior</span></td>
      <td><span class="parametername">behavior</span></td>
      <td><p>The json request behavior</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useCamelCasePropertyName</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a> value decides whether to use camel case to serialize the data.</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><span class="xref">JsonResult</span></td>
      <td><p>The json result</p>
</td>
    </tr>
  </tbody>
</table>
</div>
