public virtual void Update(TEntity entity) { _dbSet.Attach(entity); _ctx.Entry(entity).State = EntityState.Modified; }