# C1.CalcEngine.ExpressionEngine.IExpressionSyntax.RegisterFunction

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_CalcEngine_ExpressionEngine_IExpressionSyntax_RegisterFunction_" data-uid="C1.CalcEngine.ExpressionEngine.IExpressionSyntax.RegisterFunction*">RegisterFunction Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_CalcEngine_ExpressionEngine_IExpressionSyntax_RegisterFunction_" data-uid="C1.CalcEngine.ExpressionEngine.IExpressionSyntax.RegisterFunction*"></a>
<h4 id="C1_CalcEngine_ExpressionEngine_IExpressionSyntax_RegisterFunction_System_String_System_Int32_System_Int32_System_Func_System_Collections_Generic_List_C1_CalcEngine_ExpressionEngine_IExpression__System_Object__C1_CalcEngine_ItemType_" data-uid="C1.CalcEngine.ExpressionEngine.IExpressionSyntax.RegisterFunction(System.String,System.Int32,System.Int32,System.Func{System.Collections.Generic.List{C1.CalcEngine.ExpressionEngine.IExpression},System.Object},C1.CalcEngine.ItemType)">RegisterFunction(string, int, int, Func&lt;List&lt;IExpression&gt;, object&gt;, ItemType)</h4>
<div class="markdown level1 summary"><p>Registers a function that can be evaluated by expression engine.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void RegisterFunction(string functionName, int minArgsCount, int maxArgsCount, Func&lt;List&lt;IExpression&gt;, object&gt; function, ItemType functionType)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub RegisterFunction(functionName As String, minArgsCount As Integer, maxArgsCount As Integer, [function] As Func(Of List(Of IExpression), Object), functionType As ItemType)</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.string">string</a></td>
      <td><span class="parametername">functionName</span></td>
      <td><p>Function name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">minArgsCount</span></td>
      <td><p>Minimum parameter count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">maxArgsCount</span></td>
      <td><p>Maximum parameter count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="C1.CalcEngine.ExpressionEngine.IExpression.html">IExpression</a>&gt;, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</td>
      <td><span class="parametername">function</span></td>
      <td><p>Delegate that evaluates the function.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.CalcEngine.ItemType.html">ItemType</a></td>
      <td><span class="parametername">functionType</span></td>
      <td><p>Function type.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_CalcEngine_ExpressionEngine_IExpressionSyntax_RegisterFunction_" data-uid="C1.CalcEngine.ExpressionEngine.IExpressionSyntax.RegisterFunction*"></a>
<h4 id="C1_CalcEngine_ExpressionEngine_IExpressionSyntax_RegisterFunction_System_String_System_Int32_System_Func_System_Collections_Generic_List_C1_CalcEngine_ExpressionEngine_IExpression__System_Object__C1_CalcEngine_ItemType_" data-uid="C1.CalcEngine.ExpressionEngine.IExpressionSyntax.RegisterFunction(System.String,System.Int32,System.Func{System.Collections.Generic.List{C1.CalcEngine.ExpressionEngine.IExpression},System.Object},C1.CalcEngine.ItemType)">RegisterFunction(string, int, Func&lt;List&lt;IExpression&gt;, object&gt;, ItemType)</h4>
<div class="markdown level1 summary"><p>Registers a function that can be evaluated by expression engine.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void RegisterFunction(string functionName, int argsCount, Func&lt;List&lt;IExpression&gt;, object&gt; function, ItemType functionType)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub RegisterFunction(functionName As String, argsCount As Integer, [function] As Func(Of List(Of IExpression), Object), functionType As ItemType)</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.string">string</a></td>
      <td><span class="parametername">functionName</span></td>
      <td><p>Function name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">argsCount</span></td>
      <td><p>Parameter count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="C1.CalcEngine.ExpressionEngine.IExpression.html">IExpression</a>&gt;, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</td>
      <td><span class="parametername">function</span></td>
      <td><p>Delegate that evaluates the function.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.CalcEngine.ItemType.html">ItemType</a></td>
      <td><span class="parametername">functionType</span></td>
      <td><p>Function type.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
