The problem is that I tried to prepend an object to a list and it happened to me that the object wasn't added to the list at all. My code looks like this:
List<string> names = GetNames();
string defaultName = "default";
if (!names.Contains(defaultName))
names.Prepend(defaultName);
Funny thing is that when I debug the code, the Prepend() instruction was executed, but nothing happened. Therefore, I have to use List.Insert() to do the task, but I don't understand what happened here?
My name list was just a simple list that contains 4 names, nothing special, and I was using Visual studio 2017 and .Net Framework 4.7 if that be of any help.