# C1.LiveLinq.LiveViews.View.SetTransaction

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_LiveLinq_LiveViews_View_SetTransaction_" data-uid="C1.LiveLinq.LiveViews.View.SetTransaction*">SetTransaction Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_LiveLinq_LiveViews_View_SetTransaction_" data-uid="C1.LiveLinq.LiveViews.View.SetTransaction*"></a>
<h4 id="C1_LiveLinq_LiveViews_View_SetTransaction_C1_LiveLinq_ITransaction_System_Boolean_" data-uid="C1.LiveLinq.LiveViews.View.SetTransaction(C1.LiveLinq.ITransaction,System.Boolean)">SetTransaction(ITransaction, bool)</h4>
<div class="markdown level1 summary"><p>Sets the value of the <a class="xref" href="C1.LiveLinq.LiveViews.View.Transaction.html#C1_LiveLinq_LiveViews_View_Transaction">Transaction</a> property.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetTransaction(ITransaction transaction, bool allowPropertyPaths = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetTransaction(transaction As ITransaction, Optional allowPropertyPaths As Boolean = False)</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="C1.LiveLinq.ITransaction.html">ITransaction</a></td>
      <td><span class="parametername">transaction</span></td>
      <td><p>The new value for the the <a class="xref" href="C1.LiveLinq.LiveViews.View.Transaction.html#C1_LiveLinq_LiveViews_View_Transaction">Transaction</a> property.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">allowPropertyPaths</span></td>
      <td><p>Set this parameter to True to prevent exception if you have writable property paths and want to ignore them
(but be aware that updates through property paths are not tracked by the transaction). The default is False.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_LiveLinq_LiveViews_View_SetTransaction_C1_LiveLinq_ITransaction_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>If a writable property path exists in the view element type (for example, <pre><code class="lang-csharp">Order.Customer.City</code></pre>), then an exception is thrown
unless suppressed by setting <code class="paramref">allowPropertyPaths</code> to True,
because modifying properties using such paths cannot be supported by transactions.
To prevent the exception, set the <code class="paramref">allowPropertyPaths</code> parameter to True,
but make sure you do not use such property paths in your code and don't have a two-way data binding to such property path in your controls.
If you modify a property using such path in your code or through data binding, that modification happens outside the transaction scope.
</div>
</div>
