Example #1
0
 private ReturnType WithCommand <ReturnType>(Func <ICommand, ReturnType> func)
 {
     if (transactionContext != null)
     {
         return(func(transactionContext.Transaction));
     }
     else
     {
         using (var transaction = connection.BeginCommand()) {
             var result = func(transaction);
             return(result);
         }
     }
 }