如何List<ABC>
按c1
元素升序排序?非常感谢!
public class ABC
{
public string c0 { get; set; }
public string c1 { get; set; }
public string c2 { get; set; }
}
public partial class MainWindow : Window
{
public List<ABC> items = new List<ABC>();
public MainWindow()
{
InitializeComponent();
items.Add(new ABC
{
c0 = "1",
c1 = "DGH",
c2 = "yes"
});
items.Add(new ABC
{
c0 = "2",
c1 = "ABC",
c2 = "no"
});
items.Add(new ABC
{
c0 = "3",
c1 = "XYZ",
c2 = "yes"
});
}
}