public void EditCategory(Category category) { using (var tran = _session.BeginTransaction()) { _session.SaveOrUpdate(category); tran.Commit(); } }