示例#1
0
 /// <summary>
 /// 添加事务委托
 /// </summary>
 /// <param name="tranDelegate"></param>
 public void AddTransactionDelegate(TransactionDelegate tranDelegate)
 {
     tranDelegate.InCenterTime = DateTime.Now;
     lock (List)
     {
         List.Add(tranDelegate);
     }
 }
示例#2
0
 public void Test2(TransactionDelegate tran)
 {
     tran.CommitAction = () => {
         _logger.LogInformation("Controller1 Test2 提交事务");
     };
     tran.RollbackAction = () => {
         _logger.LogInformation("Controller1 Test2 回滚事务");
     };
     _logger.LogInformation("Controller1.Test2 收到头部 auth:{0}", this.Header["auth"]);
 }
示例#3
0
 /// <summary>
 /// 测试
 /// </summary>
 /// <param name="tran"></param>
 /// <param name="p">年龄</param>
 /// <param name="str">名称</param>
 /// <returns>返回需要的字符串</returns>
 public string Test(TransactionDelegate tran, int?p, string str)
 {
     tran.CommitAction = () => {
         _logger.LogInformation("Controller1 Test 提交事务");
     };
     tran.RollbackAction = () => {
         _logger.LogInformation("Controller1 Test 回滚事务");
     };
     _logger.LogInformation("Controller1 收到头部 auth:{0}", this.Header["auth"]);
     return("abc" + p + " " + str);
 }