Exemple #1
0
 protected TwoPhaseTransaction(ITwoPhaseRepository twoPhaseRepository,
                               Dictionary <string, string> transactionParams)
 {
     TransactionParams  = transactionParams;
     TwoPhaseRepository = twoPhaseRepository;
     _logger            = ApplicationLogging.CreateLogger <TwoPhaseTransaction>();
 }
        public DecreaseWalletBalanceTransaction(ITwoPhaseRepository twoPhaseRepository,
                                                Dictionary <string, string> transactionParams) : base(twoPhaseRepository, transactionParams)
        {
            if (transactionParams is null ||
                _requiredTransactionParams.Any(key => !transactionParams.ContainsKey(key)))
            {
                throw new MissingTransactionParamException();
            }

            _walletRepository = TwoPhaseRepository as WalletRepository;
            _logger           = ApplicationLogging.CreateLogger <DecreaseWalletBalanceTransaction>();
            _logger.LogInformation($"DecreaseWalletBalanceTransaction was created. Transaction Id = {TransactionId}");
        }