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(); } }
public bool Insert(TEntity tEntity) { _dbSet.Add(tEntity); return(_dbContext.SaveChanges() > 0); }