Example #1
0
        public async ValueTask <GeneralLedgerEntry> Get(GeneralLedgerEntryIdentifier identifier,
                                                        CancellationToken cancellationToken = default)
        {
            var optional = await _inner.GetOptional(identifier.ToString(), cancellationToken);

            return(optional.HasValue ? optional.Value : throw new InvalidOperationException());
        }
Example #2
0
        public async ValueTask <GeneralLedgerEntry> Get(GeneralLedgerEntryIdentifier identifier,
                                                        CancellationToken cancellationToken = default)
        {
            var optionalGeneralLedgerEntry = await _inner.GetById(identifier.ToString(), cancellationToken);

            if (!optionalGeneralLedgerEntry.HasValue)
            {
                throw new InvalidOperationException();
            }

            return(optionalGeneralLedgerEntry.Value);
        }