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