Minus Date
How to minus one day from specific date in linq????
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Khargesh RajputRank #616 · 3.9K reputationPosted May 20, 2015, 3:57 AM EDT
var yesterday = DateTime.Today.AddDays(-1); var query = from item in context.News where item.InsertDate.Date == yesterday orderby item.InsertDate descending select new { item.Id, item.InsertDate, item.NewsDescription};