예제 #1
0
 public Release GetReleaseDetails(string releaseNumber)
 {
     using (ISession session = ReleaseRepository.CreateSessionFactory().OpenSession())
     {
         using (session.BeginTransaction())
             return(session.Get <Release>((object)releaseNumber));
     }
 }
예제 #2
0
 public IEnumerable <Release> GetReleases()
 {
     using (ISession session = ReleaseRepository.CreateSessionFactory().OpenSession())
     {
         using (session.BeginTransaction())
             return((IEnumerable <Release>)session.CreateCriteria <Release>().List <Release>());
     }
 }
예제 #3
0
 public void SaveReleaseDetails(Release release)
 {
     using (ISession session = ReleaseRepository.CreateSessionFactory().OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.SaveOrUpdate((object)release);
             transaction.Commit();
         }
     }
 }