I have a generic list of objects in C#, and wish to clone the list. The items within the list are cloneable, but there doesn\'t seem to be an option to do list.Clone()
list.Clone()
I've made for my own some extension which converts ICollection of items that not implement IClonable
static class CollectionExtensions { public static ICollection Clone(this ICollection listToClone) { var array = new T[listToClone.Count]; listToClone.CopyTo(array,0); return array.ToList(); } }