HI all,
I have a below list
var listItems = new List<Item>
{
new Item() { OrderValue= 100, Balance= 90},
new Item() { OrderValue= 100, Balance= 70},
new Item() { OrderValue= 100, Balance= 0},
new Item() { OrderValue= 6, Balance= 0},
};
I need to sort the above list and get the below results
OrderValue= 100, Balance= 90 // 1st as OrderValue - Balance Difference is =10 and this value is high priority in asc order in the list
OrderValue= 100, Balance= 80 // 2nd as OrderValue - Balance Difference is =20 and this value is high priority in asc order in the list
OrderValue= 6, Balance= 0 // 3rd as OrderValue - Balance Difference is =6 but this willd not be prioratised first in the list becasue of the OrderValue is less compared to the two other list items above
OrderValue= 100, Balance= 0 // 4th as OrderValue - Balance Difference is = 100 and this will be the last priority as highst value for this should be at the last.
so how do we sort my list to get the above reslts ?