public bool Insert(List <TEntity> tEntitys) { foreach (var tEntity in tEntitys) { _dbSet.Add(tEntity); _dbContext.Entry <TEntity>(tEntity).State = EntityState.Added; } return(_dbContext.SaveChanges() > 0); }
public int Insert <TEntity>(TEntity entity) where TEntity : class { _dbContext.Entry <TEntity>(entity).State = EntityState.Added; return(dbTransaction == null?this.Commit() : 0); }