BudgetAnalyser.Engine.Ledger.LedgerBook.UnlockMostRecentLine C# (CSharp) Method

UnlockMostRecentLine() private method

Used to unlock the most recent LedgerEntryLine. Lines are locked as soon as they are saved after creation to prevent changes. Use with caution, this is intended to keep data integrity intact and prevent accidental changes. After financial records are completed for the month, they are not supposed to change.
private UnlockMostRecentLine ( ) : LedgerEntryLine
return LedgerEntryLine
        internal LedgerEntryLine UnlockMostRecentLine()
        {
            var line = Reconciliations.FirstOrDefault();
            line?.Unlock();

            return line;
        }
    }

Usage Example

        public void UnlockMostRecentLineShouldNotThrowIfBookIsEmpty()
        {
            var subject = new LedgerBook(new FakeLogger())
            {
                Name = "Foo", Modified = new DateTime(2011, 12, 4), FileName = @"C:\TestLedgerBook.xml",
            };
            LedgerEntryLine result = subject.UnlockMostRecentLine();

            Assert.IsNull(result);
        }
All Usage Examples Of BudgetAnalyser.Engine.Ledger.LedgerBook::UnlockMostRecentLine