Beispiel #1
0
        public static DaoTransaction BeginTransaction(Database db)
        {
            Database       original = db;
            DaoTransaction tx       = new DaoTransaction(original);

            Db.For(db.ConnectionName, tx.Database);
            tx.Disposed += (o, a) =>
            {
                Db.For(db.ConnectionName, original);
            };

            return(tx);
        }
Beispiel #2
0
 /// <summary>
 /// Save the current instance.  If the Id is less than or
 /// equal to 0 the current instance will be Inserted, otherwise
 /// it will be Updated.  Will also commit any updates to its
 /// children, though child commit events will not be triggerred.
 /// Same as Save
 /// </summary>
 public virtual void Commit(DaoTransaction tx)
 {
     Commit(tx.Database);
 }