Realms.Transaction.Dispose C# (CSharp) Method

Dispose() public method

Will automatically Rollback the transaction on existing scope, if not explicitly Committed.
public Dispose ( ) : void
return void
        public void Dispose()
        {
            if (!_isOpen)
            {
                return;
            }

            // var exceptionOccurred = Marshal.GetExceptionPointers() != IntPtr.Zero || Marshal.GetExceptionCode() != 0;
            var exceptionOccurred = true; // TODO: Can we find this out on iOS? Otherwise, we have to remove it!
            if (exceptionOccurred)
            {
                Rollback();
            }
            else
            {
                Commit();
            }
        }