예제 #1
0
 public int AddCategory(Category category)
 {
     using (var tran = _session.BeginTransaction())
       {
     _session.Save(category);
     tran.Commit();
     return category.Id;
       }
 }
예제 #2
0
 public void EditCategory(Category category)
 {
     using (var tran = _session.BeginTransaction())
       {
     _session.SaveOrUpdate(category);
     tran.Commit();
       }
 }