Пример #1
0
        public IActionResult Delete([FromRoute] int transactionId)
        {
            _logger.Log(LogLevel.Trace, transactionId, $"A transaction with id {transactionId} will be deleted");

            var result = _transactionsManager.RemoveOne(transactionId);

            if (!result.IsAcknowledged)
            {
                _logger.Log(LogLevel.Error, transactionId, $"A transaction with id {transactionId} couldn't be deleted");

                return(NotFound());
            }

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