9
I.E. Bir diziden seçmek istiyorsam, sonuç olarak sırasıyla IEnumerable<object>
nesnesi mi?C# koleksiyonları her zaman siparişi zorlar mı?
public class Student { public string FullName, ... }
public class School { public string Name, public Student[] Students, ... }
public void StudentListWork(School thisSchool)
{
IEnumerable<string> StudentNames = thisSchool.Students.Select(student => student.FullName);
// IS StudentNames GUARANTEED TO BE IN THE SAME ORDER AS thisSchool.Students?
}
Teşekkürler!
içlerinde yerleştirilen öğelere dayalı sıralamayı garanti geçerlidir böyle
SortedSet<T>
veSortedDictionary<TKey, TValue>
olarak@Mystere: İkinci satıra göre bir dizi. –
@Jon Skeet - Doh! kaçırdı ... –