using System.Collections.Generic; Listnumbers = new List (); numbers.Add(1); numbers.Add(2);
using System.Collections.Generic; HashSetIn summary, the IEnumerable AddItem method is an extension method that allows adding items to a sequence. The package library used depends on the implementation of the sequence interface, such as Listfruits = new HashSet (); fruits.Add("apple"); fruits.Add("banana");