public IniSet Add(IniSet item) { if (item == null) { throw new ArgumentNullException("item"); } item.Id = _nextId++; products.Add(item); return(item); }
public bool Update(IniSet item) { if (item == null) { throw new ArgumentNullException("item"); } int index = products.FindIndex(p => p.Id == item.Id); if (index == -1) { return(false); } products.RemoveAt(index); products.Add(item); return(true); }