# C1.Data.Transactions.ClientTransaction

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Data_Transactions_ClientTransaction" data-uid="C1.Data.Transactions.ClientTransaction" class="text-break">ClientTransaction Class
</h1>
  <div class="markdown level0 summary"><p>Represents a transaction that tracks client-side changes and can roll them back.</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">ClientTransaction</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="../C1.LiveLinq.4.8/C1.LiveLinq.ITransaction.html">ITransaction</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Data.Transactions.html">C1.Data.Transactions</a></h6>
  <h6><strong>Assembly</strong>: C1.Data.Entity.4.8.dll</h6>
  <h5 id="C1_Data_Transactions_ClientTransaction_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ClientTransaction : ITransaction, IDisposable, INotifyPropertyChanged</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class ClientTransaction
    Implements ITransaction, IDisposable, INotifyPropertyChanged</code></pre>
  </div>
  <h5 id="C1_Data_Transactions_ClientTransaction_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>To create a new independent transaction, use the <a class="xref" href="C1.Data.ClientCacheBase.CreateTransaction.html#C1_Data_ClientCacheBase_CreateTransaction">CreateTransaction()</a> method.
To create a child transaction, use the <a class="xref" href="C1.Data.Transactions.ClientTransaction.-ctor.html#C1_Data_Transactions_ClientTransaction__ctor_C1_Data_Transactions_ClientTransaction_">constructor</a>.</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_Data_Transactions_ClientTransaction__ctor_C1_Data_Transactions_ClientTransaction_" data-uid="C1.Data.Transactions.ClientTransaction.#ctor(C1.Data.Transactions.ClientTransaction)">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.-ctor.html#C1_Data_Transactions_ClientTransaction__ctor_C1_Data_Transactions_ClientTransaction_">ClientTransaction(ClientTransaction)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a child (nested) transaction, a new instance of the <a class="xref" href="C1.Data.Transactions.ClientTransaction.html">ClientTransaction</a> class
with a specified parent transaction.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_HasChanges" data-uid="C1.Data.Transactions.ClientTransaction.HasChanges">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.HasChanges.html#C1_Data_Transactions_ClientTransaction_HasChanges">HasChanges</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether any changes were made in the <a class="xref" href="C1.Data.Transactions.ClientTransaction.Scope.html#C1_Data_Transactions_ClientTransaction_Scope">scope</a> of
this <a class="xref" href="C1.Data.Transactions.ClientTransaction.html">transaction</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_State" data-uid="C1.Data.Transactions.ClientTransaction.State">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.State.html#C1_Data_Transactions_ClientTransaction_State">State</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="../C1.LiveLinq.4.8/C1.LiveLinq.TransactionState.html">state</a> the <a class="xref" href="C1.Data.Transactions.ClientTransaction.html">transaction</a> is in.</p>
</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_Data_Transactions_ClientTransaction_Commit" data-uid="C1.Data.Transactions.ClientTransaction.Commit">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.Commit.html#C1_Data_Transactions_ClientTransaction_Commit">Commit()</a>
        </td>
        <td class="markdown level1 summary"><p>Commits the transaction if it was not committed before. Commits changes that were made while this transaction's scope was open.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_Dispose" data-uid="C1.Data.Transactions.ClientTransaction.Dispose">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.Dispose.html#C1_Data_Transactions_ClientTransaction_Dispose">Dispose()</a>
        </td>
        <td class="markdown level1 summary"><p>Disposes of the <a class="xref" href="C1.Data.Transactions.ClientTransaction.html">ClientTransaction</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_Rollback" data-uid="C1.Data.Transactions.ClientTransaction.Rollback">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.Rollback.html#C1_Data_Transactions_ClientTransaction_Rollback">Rollback()</a>
        </td>
        <td class="markdown level1 summary"><p>Rolls back the transaction.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_Scope" data-uid="C1.Data.Transactions.ClientTransaction.Scope">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.Scope.html#C1_Data_Transactions_ClientTransaction_Scope">Scope()</a>
        </td>
        <td class="markdown level1 summary"><p>Opens the transaction scope.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_ScopeDataContext_System_Object_" data-uid="C1.Data.Transactions.ClientTransaction.ScopeDataContext(System.Object)">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.ScopeDataContext.html#C1_Data_Transactions_ClientTransaction_ScopeDataContext_System_Object_">ScopeDataContext(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Wraps an object so the transaction <a class="xref" href="C1.Data.Transactions.ClientTransaction.Scope.html#C1_Data_Transactions_ClientTransaction_Scope">scope</a> is automatically opened
when a value is being assigned to a property of the wrapped object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Data_Transactions_ClientTransaction_PropertyChanged" data-uid="C1.Data.Transactions.ClientTransaction.PropertyChanged">
          <a class="xref" href="C1.Data.Transactions.ClientTransaction.PropertyChanged.html">PropertyChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when a property value changes, after it has been changed.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
