Sounds like you want something like:
var query = db.Statuses
.OrderByDescending(x => x.LastDateInspected)
.FirstOrDefault();
That will return null
if there are no entries, or the value with the latest LastDateInspected
value otherwise (i.e. the first result, having ordered by the last date inspected latest-first).
That will get you the whole record, of course. If you only want the date, you can select the LastDateInspected
column.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…