navigation
Linq

Get last record with filter condition true in linq

| | ASP-NET , Linq

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();