public void EditPost(Post post) { using (var tran = _session.BeginTransaction()) { _session.SaveOrUpdate(post); tran.Commit(); } }