Esempio n. 1
0
 public void Commit()
 {
     using (ITransaction transaction =
                SessionFactory.GetCurrentSession(this._context).BeginTransaction()) {
         try { transaction.Commit(); }
         catch (Exception ex) {
             transaction.Rollback();
             throw;
         }
     }
 }
Esempio n. 2
0
 public void RegisterAmended(IAggregateRoot entity,
                             IUnitOfWorkRepository unitofWorkRepository)
 {
     SessionFactory.GetCurrentSession(this._context).SaveOrUpdate(entity);
 }
Esempio n. 3
0
 public void RegisterRemoved(IAggregateRoot entity,
                             IUnitOfWorkRepository unitofWorkRepository)
 {
     SessionFactory.GetCurrentSession(this._context).Delete(entity);
 }
Esempio n. 4
0
 public void RegisterNew(IAggregateRoot entity, IUnitOfWorkRepository unitofWorkRepository)
 {
     SessionFactory.GetCurrentSession().Save(entity);
 }