# C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine*">AddDataEngine Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine*"></a>
<h4 id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine_System_String_System_String_System_String_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine(System.String,System.String,System.String)">AddDataEngine(string, string, string)</h4>
<div class="markdown level1 summary"><p>Adds a DataEngine data which data files already exist.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public FlexPivotEngineProviderManager AddDataEngine(string name, string workspace, string tableName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function AddDataEngine(name As String, workspace As String, tableName As String) As FlexPivotEngineProviderManager</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">name</span></td>
      <td><p>The unique value used to stand for the data source.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">workspace</span></td>
      <td><p>Path in the server's file system where DataEngine data files locate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">tableName</span></td>
      <td><p>The name of the DataEngine table.</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="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.html">FlexPivotEngineProviderManager</a></td>
      <td><p>The flex pivot engine provider manager.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine*"></a>
<h4 id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine_System_String_System_Data_Common_DbCommand_System_Data_Common_DbConnection_System_String_System_String_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine(System.String,System.Data.Common.DbCommand,System.Data.Common.DbConnection,System.String,System.String)">AddDataEngine(string, DbCommand, DbConnection, string, string)</h4>
<div class="markdown level1 summary"><p>Adds a DataEngine data from a database.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public FlexPivotEngineProviderManager AddDataEngine(string name, DbCommand command, DbConnection connection = null, string workspace = null, string tableName = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function AddDataEngine(name As String, command As DbCommand, Optional connection As DbConnection = Nothing, Optional workspace As String = Nothing, Optional tableName As String = Nothing) As FlexPivotEngineProviderManager</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">name</span></td>
      <td><p>The unique value used to stand for the data source.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand">DbCommand</a></td>
      <td><span class="parametername">command</span></td>
      <td><p>ADO.NET command object for retrieving data from the database. The connection in the command should be open.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection">DbConnection</a></td>
      <td><span class="parametername">connection</span></td>
      <td><p>An open ADO.NET connection object for connecting to the database.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">workspace</span></td>
      <td><p>Path in the server's file system where DataEngine data is saved in files.
If it is set to null or not set, the default workspace is used.
The default workspace path is &quot;application base path + /Data&quot;.
You can change it via the <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder">IApplicationBuilder</a>.SetDefaultWorkspacePath(string path) method.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">tableName</span></td>
      <td><p>The name of the DataEngine table.
If it is set to null or not set, the value of the name parameter is 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="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.html">FlexPivotEngineProviderManager</a></td>
      <td><p>The flex pivot engine provider manager.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine*"></a>
<h4 id="C1_Web_Api_DataEngine_Data_FlexPivotEngineProviderManager_AddDataEngine__1_System_String_System_Func_System_Collections_Generic_IEnumerable___0___System_String_System_String_" data-uid="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.AddDataEngine``1(System.String,System.Func{System.Collections.Generic.IEnumerable{``0}},System.String,System.String)">AddDataEngine&lt;T&gt;(string, Func&lt;IEnumerable&lt;T&gt;&gt;, string, string)</h4>
<div class="markdown level1 summary"><p>Adds a DataEngine data from an arbitrary IEnumerable.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public FlexPivotEngineProviderManager AddDataEngine&lt;T&gt;(string name, Func&lt;IEnumerable&lt;T&gt;&gt; dataGetter, string workspace = null, string tableName = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function AddDataEngine(Of T)(name As String, dataGetter As Func(Of IEnumerable(Of T)), Optional workspace As String = Nothing, Optional tableName As String = Nothing) As FlexPivotEngineProviderManager</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">name</span></td>
      <td><p>The unique value used to stand for the data source.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-1">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;&gt;</td>
      <td><span class="parametername">dataGetter</span></td>
      <td><p>A function to get an arbitrary IEnumerable.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">workspace</span></td>
      <td><p>Path in the server's file system where DataEngine data is saved in files.
If it is set to null or not set, the default workspace is used.
The default workspace path is &quot;application base path + /Data&quot;.
You can change it via the <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder">IApplicationBuilder</a>.SetDefaultWorkspacePath(string path) method.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">tableName</span></td>
      <td><p>The name of the DataEngine table.
If it is set to null or not set, the value of the name parameter is 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="C1.Web.Api.DataEngine.Data.FlexPivotEngineProviderManager.html">FlexPivotEngineProviderManager</a></td>
      <td><p>The flex pivot engine provider manager.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
