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