Example #1
0
 public StorageResult DeleteOne(MenuItemDTO menuItem)
 {
     try
     {
         using (ISession session = NHibernateHelper.OpenSession())
             using (ITransaction transaction = session.BeginTransaction())
             {
                 session.Delete(menuItem);
                 transaction.Commit();
             }
         return(StorageResult.Success);
     }
     catch (Exception)
     {
         return(StorageResult.Failed);
     }
 }
Example #2
0
 public StorageResult UpdateOne(MenuItemDTO menuItem)
 {
     try
     {
         using (ISession session = NHibernateHelper.OpenSession())
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Update(menuItem);
             transaction.Commit();
         }
         return StorageResult.Success;
     }
     catch (Exception)
     {
         return StorageResult.Failed;
     }
 }