Esempio n. 1
0
        /// <summary>
        /// Add after action to current transaction.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="name">The name.</param>
        /// <param name="predicate">The predicate.</param>
        /// <param name="keys">The keys.</param>
        private void addAfterAction(Action action, string name, IsIncludedPredicate predicate, params object[] keys)
        {
            var transactionAction = new TransactionAction(action, name, predicate, keys);

            //attach to current transaction or to root
            Transactions.AttachAfterAction(Transactions.CurrentTransaction, transactionAction);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransactionAction" /> class.
 /// </summary>
 /// <param name="action">The action that will be executed.</param>
 /// <param name="name">The name of transaction action.</param>
 /// <param name="predicate">The predicate determining whether action is
 /// included in transaction already.</param>
 /// <param name="keys">The stored keys that helps action identification.</param>
 public TransactionAction(Action action, string name, IsIncludedPredicate predicate, params object[] keys)
 {
     _action    = action;
     Name       = name;
     _predicate = predicate;
     //defensive copy
     _keys = keys.ToArray();
 }