Пример #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();
         }
     }
 }