我们可以有类似的东西 -
Dictionary<string, string> dict = new Dictionary<string, string>();
List<string> keysList= new List<string>();
List<string>valuesList= new List<string>();
//Assuming both the list have the same number of items
dict.keys = keysList;
dict.values = valuesList;
大多数情况下,我想知道是否有办法通过直接将键和值分配给列表来填充它们?