internal TransactionEvent(TransactionEventProvider transactionEventProvider, int sequence, TransactionEventType transactionEventType, string data)
            : this()
        {
            Contract.Requires(transactionEventProvider != null);
            Contract.Requires(transactionEventType != null);
            Contract.Requires(!string.IsNullOrWhiteSpace(data));

            TransactionEventProvider = transactionEventProvider;
            Sequence             = sequence;
            Data                 = data;
            TransactionEventType = transactionEventType;
        }
        private TransactionEventProvider AddOrReturnTransactionEventProvider(int eventProviderId)
        {
            Contract.Ensures(Contract.Result <TransactionEventProvider>() != null);

            var transactionEventProvider = _transactionEventProviders.FirstOrDefault(x => x.EventProviderId == eventProviderId);

            if (transactionEventProvider == null)
            {
                transactionEventProvider = new TransactionEventProvider(this, eventProviderId);
                _transactionEventProviders.Add(transactionEventProvider);
            }

            return(transactionEventProvider);
        }