var myList = new List<int>(); foreach (KeyValuePair<int, int> x in existingAssets) { myList.Add(x.Key); } var myArray = myList.ToArray();
What is above may merely become...
var myArray = existingAssets.Select(x => x.Key).ToArray();
No comments:
Post a Comment