using System.Collections;
using System.Collections.Generic;
public static void Main()
var list = new List<DataInfo>();
list.Add(new DataInfo(){ Name = "2", SortIndex = 2});
list.Add(new DataInfo(){ Name = "1", SortIndex = 1});
var m = list.Min(d => d);
Console.WriteLine(m.Name);
Console.WriteLine("Hello World");
public class DataInfo: IComparable<DataInfo>
public int CompareTo(DataInfo other)
return this.SortIndex.CompareTo(other.SortIndex);