예제 #1
0
 /// <summary> 使用分布式事务 </summary>
 /// <param name="action"></param>
 /// <param name="level"></param>
 /// <param name="timeout"></param>
 public static void Use(Action action, IsolationLevel level = IsolationLevel.ReadUncommitted,
     TimeSpan? timeout = null)
 {
     using (var trans = new DTransaction(level, timeout))
     {
         action();
         trans.SaveChanges();
     }
 }
예제 #2
0
 /// <summary> 使用分布式事务 </summary>
 /// <param name="action"></param>
 /// <param name="level"></param>
 /// <param name="timeout"></param>
 public static void Use(Action action, IsolationLevel level = IsolationLevel.ReadUncommitted,
                        TimeSpan?timeout = null)
 {
     using (var trans = new DTransaction(level, timeout))
     {
         action();
         trans.SaveChanges();
     }
 }