Exemplo n.º 1
0
 public void SessionTxVerification()
 {
     using (var scope = new SessionScope()) {
         scope.Execute <SSAFEntity>(session => {
             using (ITransaction tx = session.BeginTransaction())
             {
                 Assert.AreSame(tx, session.BeginTransaction());
                 Assert.AreSame(tx, session.Transaction);
             }
         });
     }
 }
Exemplo n.º 2
0
 public void NHibernateVerification()
 {
     using (var scope = new SessionScope()) {
         scope.Execute <SSAFEntity>(session => {
             using (session.BeginTransaction())
             {
                 session.Save(new SSAFEntity("example"));
                 Assert.AreEqual(1, session.CreateQuery("from " + typeof(SSAFEntity).FullName).List <SSAFEntity>().Count);
             }
         });
     }
 }