I have a list which elements follows a sequence. I want use aggregate with OrderBy and ThenBy
List<string> list = new List<string> {"codCustomer", "customerName", "address1", "address2"};
list = list
.OrderBy(o => o.codCustomer)
.ThenBy(o => o.customerName)
.ThenBy(o => o.address1)
.ThenBy(o => o.addres2)
This list contain many elements and I want use aggregate with OrderBy and ThenBy, but I don't know how do it.
The matter is that this list is passed as a parameter and contains the fields to sort.