var tempList = new List<string> { "Name", "DOB", "Address" };
With the collection initializer syntax, you don't even need explicit calls to Add()or Insert(). The compiler will post them for you.
The above declaration is actually compiled to:
List<string> tempList = new List<string>();
tempList.Add("Name");
tempList.Add("DOB");
tempList.Add("Address");
source
share