I have a table like below
Customers Id jan feb mar apr.........dec 1 10 12 12 10 .........40 2 11 13 12 10 .........42
I want to write Linq Expression to return order by total(jan+feb…dec) desc
I want something like customers.OrderbyDesc(p=>Sum(p.jan,p.feb,.p.dec).
Note: There is no total column at the end.
If there is a way I can project the sum into temp variable and then sort it?
Sure – something like:
You don’t need to use
Sumhere… just normal addition.