public void Update(T entity) { _dbContext.Set <T>().Attach(entity); _dbContext.Entry(entity).State = EntityState.Modified; }
public Repository(InfoHubContext dbContext) { _dbContext = dbContext ?? throw new ArgumentNullException("dbContext can not be null."); _dbSet = dbContext.Set <T>(); }