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