I have an object called RateQuote that has the following:
- Name
- Term
- Miles
For example:
rate = new RateQuote() {
Term = 24,
Miles = 120000,
Name = '24 mo. / 120000 miles'
}
and
rate = new RateQuote() {
Term = 24,
Miles = 50000,
Name = '24 mo. / 50000 miles'
}
and
rate = new RateQuote() {
Term = 12,
Miles = 50000,
Name = '12 mo. / 50000 miles'
}
These RateQuote's are getting added to a RateQuote[] object:
public void AddRate(RateQuote rate)
{
Rates = Rates.Concat(new RateQuote[] { rate }).ToArray();
}
After they are added by the .Concat, how would I sort it? If my code adds the "24 mo. / 120000 miles" first, then the "24 mo. / 50,000 miles" second and then the "12 mo. / 50000 miles" last, I would want it to sort it so that it is in this order:
- 12 mo. / 50000
- 24 mo. / 50000
- 24 mo. / 120000
It should sort by months first, then miles. I am confused and would appreciate help. I know there is a .Sort function I can use, but not sure how to use it in this context. Thank you in advance for all of your help.
List<RateQuote>?