Q:

EF Select MAX value that is <= 5

I can not figure out how using EF to select a DB row, based on its maximum value but wich 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)
Thank you for your time!

A:

How about:
Price p = db.Prices
    .Where(p => p.numdays <= totaldays)
    .OrderByDescending(p => p.numdays)
    .First()

