示例#1
0
文件: Db.cs 项目: dekkerb115/Bam.Net
        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);
        }
示例#2
0
文件: Dao.cs 项目: ThreeHeadz/Bam.Net
 /// <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);
 }