예제 #1
0
        public IActionResult GetTransaction([FromRoute] int transactionId)
        {
            _logger.Log(LogLevel.Trace, transactionId, $"A transaction with id {transactionId} is being consulted");
            var result = _transactionsManager.GetOne(transactionId);

            if (result == null)
            {
                _logger.Log(LogLevel.Error, transactionId, $"A transaction with id {transactionId} couldn't be found");
                return(NotFound());
            }

            _logger.Log(LogLevel.Information, transactionId, $"A transaction with id {transactionId} was retrieved successfully");

            return(Ok(result));
        }