The method List<T>.AddRange(IEnumerable<T>)
adds a collection of items to the end of the list:
myList.AddRange(moreItems); // Adds moreItems to the end of myList
What is the best way to add a collection of items (as some IEnumerable<T>
) to the beginning of the list?
Use InsertRange method:
myList.InsertRange(0, moreItems);