# Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV*">UseCSV Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV*"></a>
<h4 id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_Microsoft_EntityFrameworkCore_DbContextOptionsBuilder_System_String_System_Action_C1_EntityFrameworkCore_CSV_CSVDbContextOptionsBuilder__" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder,System.String,System.Action{C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder})">UseCSV(DbContextOptionsBuilder, string, Action&lt;CSVDbContextOptionsBuilder&gt;)</h4>
<div class="markdown level1 summary"><p>Configures the context to connect to a CSV database.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DbContextOptionsBuilder UseCSV(this DbContextOptionsBuilder optionsBuilder, string connectionString, Action&lt;CSVDbContextOptionsBuilder&gt; optionsAction = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function UseCSV(optionsBuilder As DbContextOptionsBuilder, connectionString As String, Optional optionsAction As Action(Of CSVDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder</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">DbContextOptionsBuilder</span></td>
      <td><span class="parametername">optionsBuilder</span></td>
      <td><p>The builder being used to configure the context.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">connectionString</span></td>
      <td><p>The connection string of the database to connect to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder.html">CSVDbContextOptionsBuilder</a>&gt;</td>
      <td><span class="parametername">optionsAction</span></td>
      <td><p>An optional action to allow additional CSV specific configuration.</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">DbContextOptionsBuilder</span></td>
      <td><p>The options builder so that further configuration can be chained.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV*"></a>
<h4 id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_Microsoft_EntityFrameworkCore_DbContextOptionsBuilder_System_Data_Common_DbConnection_System_Action_C1_EntityFrameworkCore_CSV_CSVDbContextOptionsBuilder__" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder,System.Data.Common.DbConnection,System.Action{C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder})">UseCSV(DbContextOptionsBuilder, DbConnection, Action&lt;CSVDbContextOptionsBuilder&gt;)</h4>
<div class="markdown level1 summary"><p>Configures the context to connect to a CSV database.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DbContextOptionsBuilder UseCSV(this DbContextOptionsBuilder optionsBuilder, DbConnection connection, Action&lt;CSVDbContextOptionsBuilder&gt; optionsAction = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function UseCSV(optionsBuilder As DbContextOptionsBuilder, connection As DbConnection, Optional optionsAction As Action(Of CSVDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder</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">DbContextOptionsBuilder</span></td>
      <td><span class="parametername">optionsBuilder</span></td>
      <td><p>The builder being used to configure the context.</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 existing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection">DbConnection</a> to be used to connect to the database. If the connection is
in the open state then EF will not open or close the connection. If the connection is in the closed
state then EF will open and close the connection as needed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder.html">CSVDbContextOptionsBuilder</a>&gt;</td>
      <td><span class="parametername">optionsAction</span></td>
      <td><p>An optional action to allow additional CSV specific configuration.</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">DbContextOptionsBuilder</span></td>
      <td><p>The options builder so that further configuration can be chained.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV*"></a>
<h4 id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV__1_Microsoft_EntityFrameworkCore_DbContextOptionsBuilder___0__System_String_System_Action_C1_EntityFrameworkCore_CSV_CSVDbContextOptionsBuilder__" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV``1(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder{``0},System.String,System.Action{C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder})">UseCSV&lt;TContext&gt;(DbContextOptionsBuilder&lt;TContext&gt;, string, Action&lt;CSVDbContextOptionsBuilder&gt;)</h4>
<div class="markdown level1 summary"><p>Configures the context to connect to a CSV database.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DbContextOptionsBuilder&lt;TContext&gt; UseCSV&lt;TContext&gt;(this DbContextOptionsBuilder&lt;TContext&gt; optionsBuilder, string connectionString, Action&lt;CSVDbContextOptionsBuilder&gt; optionsAction = null) where TContext : DbContext</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function UseCSV(Of TContext As DbContext)(optionsBuilder As DbContextOptionsBuilder(Of TContext), connectionString As String, Optional optionsAction As Action(Of CSVDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder(Of TContext)</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">DbContextOptionsBuilder</span>&lt;TContext&gt;</td>
      <td><span class="parametername">optionsBuilder</span></td>
      <td><p>The builder being used to configure the context.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">connectionString</span></td>
      <td><p>The connection string of the database to connect to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder.html">CSVDbContextOptionsBuilder</a>&gt;</td>
      <td><span class="parametername">optionsAction</span></td>
      <td><p>An optional action to allow additional CSV specific configuration.</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">DbContextOptionsBuilder</span>&lt;TContext&gt;</td>
      <td><p>The options builder so that further configuration can be chained.</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">TContext</span></td>
      <td><p>The type of context to be configured.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV_" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV*"></a>
<h4 id="Microsoft_EntityFrameworkCore_CSVDbContextOptionsBuilderExtensions_UseCSV__1_Microsoft_EntityFrameworkCore_DbContextOptionsBuilder___0__System_Data_Common_DbConnection_System_Action_C1_EntityFrameworkCore_CSV_CSVDbContextOptionsBuilder__" data-uid="Microsoft.EntityFrameworkCore.CSVDbContextOptionsBuilderExtensions.UseCSV``1(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder{``0},System.Data.Common.DbConnection,System.Action{C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder})">UseCSV&lt;TContext&gt;(DbContextOptionsBuilder&lt;TContext&gt;, DbConnection, Action&lt;CSVDbContextOptionsBuilder&gt;)</h4>
<div class="markdown level1 summary"><p>Configures the context to connect to a CSV database.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DbContextOptionsBuilder&lt;TContext&gt; UseCSV&lt;TContext&gt;(this DbContextOptionsBuilder&lt;TContext&gt; optionsBuilder, DbConnection connection, Action&lt;CSVDbContextOptionsBuilder&gt; optionsAction = null) where TContext : DbContext</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function UseCSV(Of TContext As DbContext)(optionsBuilder As DbContextOptionsBuilder(Of TContext), connection As DbConnection, Optional optionsAction As Action(Of CSVDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder(Of TContext)</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">DbContextOptionsBuilder</span>&lt;TContext&gt;</td>
      <td><span class="parametername">optionsBuilder</span></td>
      <td><p>The builder being used to configure the context.</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 existing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection">DbConnection</a> to be used to connect to the database. If the connection is
in the open state then EF will not open or close the connection. If the connection is in the closed
state then EF will open and close the connection as needed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="C1.EntityFrameworkCore.CSV.CSVDbContextOptionsBuilder.html">CSVDbContextOptionsBuilder</a>&gt;</td>
      <td><span class="parametername">optionsAction</span></td>
      <td><p>An optional action to allow additional CSV specific configuration.</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">DbContextOptionsBuilder</span>&lt;TContext&gt;</td>
      <td><p>The options builder so that further configuration can be chained.</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">TContext</span></td>
      <td><p>The type of context to be configured.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
