/// <summary> /// Cập nhật thông tin /// </summary> /// <param name="color"></param> public void Update(Color color) { _context.Colors.Attach(color); _context.Entry(color).State = EntityState.Modified; SaveChanges(); }
/// <summary> /// Xóa theo ID /// </summary> /// <param name="color"></param> public void Delete(Color color) { _context.Colors.Remove(color); SaveChanges(); }
/// <summary> /// Thêm mới /// </summary> /// <param name="color"></param> /// <returns></returns> public void Add(Color color) { _context.Colors.Add(color); SaveChanges(); }