The problem I am having is displaying records from a database which are no more than 14 days old. The idea is that someone would create an advert and it would be displayed for two weeks only.
I am New to LinQ and finding the syntax for such a query difficult to comprehend.
The following query has been created to display all the adverts shown below.
var Adverts = from m in db. Adverts
select m;
Below is what I am trying to achieve.
var Adverts = from m in db. Adverts
where m.date == DateTime.Now
---- Unsure of how to input a date range ------
select m;
Any advice welocme.
1 Answer