Пример #1
0
 public static void Transaction(IConnectionContext cc, Action <IConnectionContext> handler)
 {
     using (cc)
     {
         cc.BeginTransaction();
         handler(cc);
         cc.Commit();
     }
 }
Пример #2
0
 public static void Transaction(string name, Action <IConnectionContext> handler)
 {
     using (IConnectionContext cc = DbContext.Get(name))
     {
         cc.BeginTransaction();
         handler(cc);
         cc.Commit();
     }
 }