Kerollos Adel
insert item in the top of list
Source
public static List<T> InsertFirst<T>(this List<T> lst, T Obj)
{
List<T> NewList = new List<T>();
NewList.Add(Obj);
NewList.AddRange(lst);
return NewList;
}
Example
List<int> NumberList = new List<int>() {0 , 1, 2, 3, 4, 5, 6, 7 };
NumberList = NumberList.InsertFirst(-1);