I have a query which returns true or false depending on two conditions. One of the conditions is check whether the time (today's time) from the DB is less than or equal to 5 minutes (i.e 300 seconds). I tried defining a variable of DateTime format as follows
System.DateTime customDate= new System.DateTime(0000, 00, 00, 0, 00, 300);
here is the query
bool result = (from a in this.db.Samples
where a.Ping == "Online"
&&
(EntityFunctions.TruncateTime(a.date) - DateTime.Now) <= customDate
select a).Any();
but I have the following error
Operator '<=' cannot be applied to operands of type 'System.TimeSpan?' and System.DateTime'
kindly help.