public class CarSpecs { public String CarName { get; set; } public String CarMaker { get; set; } public DateTime CreationDate { get; set; } }
To extend the answer of Noldorin, in order to sort a list with int datatype this can be used:
listName.Sort((x, y) => x.CompareTo(y));
Or if you have a complex object in the list:
inventoryList.Sort((x, y) => x.stockNumber.CompareTo(y.stockNumber));