示例#1
0
 public void Commit()
 {
     using (ITransaction transaction = SessionFactory.GetCurrentSession().BeginTransaction())
     {
         try
         {
             transaction.Commit();
         }
         catch (Exception ex)
         {
             transaction.Rollback();
             throw;
         }
     }
 }
示例#2
0
 public void RegisterRemoved(IAggregateRoot entity, IUnitOfWorkRepository unitOfWorkRepository)
 {
     SessionFactory.GetCurrentSession().Delete(entity);
 }
示例#3
0
 public void RegisterNew(IAggregateRoot entity, IUnitOfWorkRepository unitOfWorkRepository)
 {
     SessionFactory.GetCurrentSession().Save(entity);
 }