public void Update(Survey survey) { using (ISession session = sessionManager.OpenSession()) using(var t=session.BeginTransaction()) { session.SaveOrUpdate(survey); t.Commit(); } }
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; } }