# C1.Data.Transactions.ClientTransaction.Scope

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Data_Transactions_ClientTransaction_Scope_" data-uid="C1.Data.Transactions.ClientTransaction.Scope*">Scope Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Data_Transactions_ClientTransaction_Scope_" data-uid="C1.Data.Transactions.ClientTransaction.Scope*"></a>
<h4 id="C1_Data_Transactions_ClientTransaction_Scope" data-uid="C1.Data.Transactions.ClientTransaction.Scope">Scope()</h4>
<div class="markdown level1 summary"><p>Opens the transaction scope.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IDisposable Scope()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Scope() As IDisposable</code></pre>
</div>
<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="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></td>
      <td><p>An instance of an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a> that will close the scope when its <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable.dispose">Dispose()</a> method is called.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="../C1.LiveLinq.4.8/C1.LiveLinq.ITransaction.Scope.html#C1_LiveLinq_ITransaction_Scope">ITransaction.Scope()</a></div>
<h5 id="C1_Data_Transactions_ClientTransaction_Scope_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The transaction tracks changes only when they are made inside an open scope.</p>
<p>Calling <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable.dispose">Dispose()</a> on the return value closes the scope.</p>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>The <span class="xref">ClientTransaction.State</span> is not <a class="xref" href="../C1.LiveLinq.4.8/C1.LiveLinq.TransactionState.html#C1_LiveLinq_TransactionState_Open">Open</a>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
