public int AddPost(Post post) { using (var tran = _session.BeginTransaction()) { _session.Save(post); tran.Commit(); return post.Id; } }