internal TransactionBase(NativeRuntime.IFabricTransactionBase nativeTransactionBase) { this.NativeTransactionBase = nativeTransactionBase; this.Id = this.NativeTransactionBase.get_Id(); this.IsolationLevel = (TransactionIsolationLevel)this.NativeTransactionBase.get_IsolationLevel(); this.linkedDisposables = new Collection <IDisposable>(); }
/// <summary> /// <para>The dispose event occurs when the transaction is disposed of through the <languageKeyword>OnDispose</languageKeyword> method.</para> /// </summary> /// <remarks> /// <para>When overriding <see cref="System.Fabric.Transaction.OnDispose" />, be sure to call the <languageKeyword>OnDispose</languageKeyword> /// method on the base class.</para> /// </remarks> protected internal virtual void OnDispose() { foreach (var disposable in this.linkedDisposables) { disposable.Dispose(); } if (this.NativeTransactionBase != null) { Marshal.FinalReleaseComObject(this.NativeTransactionBase); this.NativeTransactionBase = null; } }