Linq

Get last record with filter condition true in linq

Get last record with filter condition true in linq, someone asked me to explain?

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

Post your comments / questions