I can not figure out how using EF to select a DB row, based on its maximum value but which is lower or equals 5.
Here is my code, but this will select only a value, and not entire row:
Prices pr = db.Prices.Where(s => s.numdays <= totaldays).Max(s=>s.numdays)
How about: