Those are my old Code that cannot response correct result.
IList<string> testList=new List<string>();
testList.Add("string1");
var testList2=new List<string>(testList);
testList.ToList().AddRange(testList2);
I expect there are two elements in testList,but in fact it only have one; If i change my to code to new style ,its can get the right result.Example :
IList<string> testList=new List<string>();
testList.Add("string1");
var testList2=new List<string>(testList);
var result=testList.ToList();
result.AddRange(testList2);
In result,it successfully have two elements.I guess the reason is iList().toList() create a new List in other place,as param result,that is independent from iList(). Is it right? or other reasons?