コード例 #1
0
 public void Update(Survey survey)
 {
     using (ISession session = sessionManager.OpenSession())
     using(var t=session.BeginTransaction())
     {
         session.SaveOrUpdate(survey);
         t.Commit();
     }
 }
コード例 #2
0
 public Survey Create(string name, string title, string description)
 {
     using (ISession session = sessionManager.OpenSession())
     using (var t=session.BeginTransaction())
     {
         var s = new Survey { Name = name, Title = title, Description = description };
         session.SaveOrUpdate(s);
         t.Commit();
         return s;
     }
 }