Beispiel #1
0
 public int Commit()
 {
     try
     {
         var returnValue = _dbContext.SaveChanges();
         if (dbTransaction != null)
         {
             dbTransaction.Commit();
         }
         return(returnValue);
     }
     catch (Exception)
     {
         if (dbTransaction != null)
         {
             this.dbTransaction.Rollback();
         }
         throw;
     }
     finally
     {
         this.Dispose();
     }
 }
Beispiel #2
0
 public bool Insert(TEntity tEntity)
 {
     _dbSet.Add(tEntity);
     return(_dbContext.SaveChanges() > 0);
 }