using System.Collections.Generic;
public static void Main()
IList<DataCollectionProfile> dcpList = new List<DataCollectionProfile>() {
new DataCollectionProfile() { Year = 2023, Quarter = 1, TimeStamp = DateTime.Parse("2022-07-21 23:56:16.883") } ,
new DataCollectionProfile() { Year = 2022, Quarter = 4, TimeStamp = DateTime.Parse("2023-01-23 18:03:08.660") } ,
new DataCollectionProfile() { Year = 2022, Quarter = 1, TimeStamp = DateTime.Parse("2021-12-22 23:17:49.037") },
new DataCollectionProfile() { Year = 2021, Quarter = 3, TimeStamp = DateTime.Parse("2021-06-30 22:36:44.370") }
var dcpSorted = dcpList.OrderByDescending(a => a.Year).ThenByDescending(a => a.Quarter).ThenByDescending(a => a.TimeStamp);
foreach(var dcp in dcpSorted)
Console.WriteLine("DCP: { Year: " + dcp.Year + ", Quarter: " + dcp.Quarter + ", TimeStamp: " + dcp.TimeStamp + " }");
public class DataCollectionProfile {
public int Year { get; set; }
public int Quarter { get; set; }
public DateTime TimeStamp {get; set; }