예제 #1
0
 public virtual IList <T> GetAll()
 {
     using (ISession session = NHibernateUtils.OpenSession())
     {
         return(session.QueryOver <T>().List());
     }
 }
예제 #2
0
 public virtual void Delete(T item)
 {
     using (ISession session = NHibernateUtils.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Delete(item);
             transaction.Commit();
         }
     }
 }