public void Update(T entity)
        {
            var set = _context.Set <T>();

            set.Attach(entity);
            var entry = _context.Entry(entity);

            entry.State = EntityState.Modified;
            _context.SaveChanges();
        }
 public void Update(T entity)
 {
     _context.Set <T>().Attach(entity);
     _context.Entry(entity).State = EntityState.Modified;
 }