# C1.Web.Api.StringModelBinder

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Web_Api_StringModelBinder" data-uid="C1.Web.Api.StringModelBinder" class="text-break">StringModelBinder Class
</h1>
  <div class="markdown level0 summary"><p>Model binder for return raw string value.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">StringModelBinder</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.mvc.modelbinding.imodelbinder">IModelBinder</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Web.Api.html">C1.Web.Api</a></h6>
  <h6><strong>Assembly</strong>: C1.AspNetCore.Api.dll</h6>
  <h5 id="C1_Web_Api_StringModelBinder_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class StringModelBinder : IModelBinder</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class StringModelBinder
    Implements IModelBinder</code></pre>
  </div>
  <h5 id="C1_Web_Api_StringModelBinder_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>For the default model binder, the empty string will be converted to null.
This model binder will keep the raw string value, including empty string.</p>
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Api_StringModelBinder__ctor" data-uid="C1.Web.Api.StringModelBinder.#ctor">
          <a class="xref" href="C1.Web.Api.StringModelBinder.-ctor.html#C1_Web_Api_StringModelBinder__ctor">StringModelBinder()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Api_StringModelBinder_BindModelAsync_Microsoft_AspNetCore_Mvc_ModelBinding_ModelBindingContext_" data-uid="C1.Web.Api.StringModelBinder.BindModelAsync(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext)">
          <a class="xref" href="C1.Web.Api.StringModelBinder.BindModelAsync.html#C1_Web_Api_StringModelBinder_BindModelAsync_Microsoft_AspNetCore_Mvc_ModelBinding_ModelBindingContext_">BindModelAsync(ModelBindingContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Binds the model to a value by using the binding context.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
