Beispiel #1
0
        public IniSet Add(IniSet item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            item.Id = _nextId++;
            products.Add(item);
            return(item);
        }
Beispiel #2
0
        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);
        }