You can filter the last record from the list of records with filter condition using the following query.
var qry = db.Submits
.Where(m => m.Published == false)
.OrderByDescending(m => m.SubmitId)
.First();
You can filter the last record from the list of records with filter condition using the following query.
var qry = db.Submits
.Where(m => m.Published == false)
.OrderByDescending(m => m.SubmitId)
.First();