I have problem while retrieving the records which are not older than 30 days. As today's date is 24 Jun, I would like to select records not beyond than 23rd May. That is I need all records for the days in between 23rd May and Today. For that The following query was being implemented
session.QueryOver<Property>().WhereRestrictionOn(x => x.DateUpdated).IsBetween(DateTime.Now).And(DateTime.Now.AddDays(-30)).List();
The Query was running with out any errors but the List was empty.
When seen through visual studio debugger it is saying that
session.QueryOver().WhereRestrictionOn(x => x.DateUpdated).IsBetween(DateTime.Now).And(DateTime.Now.AddDays(-30)).List() Expression cannot contain lambda expressions
I wrote the query as per the mock up seen from here.