Example #1
0
 /// <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();
 }
Example #2
0
 /// <summary>
 /// Xóa theo ID
 /// </summary>
 /// <param name="color"></param>
 public void Delete(Color color)
 {
     _context.Colors.Remove(color);
     SaveChanges();
 }
Example #3
0
 /// <summary>
 /// Thêm mới
 /// </summary>
 /// <param name="color"></param>
 /// <returns></returns>
 public void Add(Color color)
 {
     _context.Colors.Add(color);
     SaveChanges();
 }