If I have a Linq to SQL expression like this:
from subscription in dbContext.Subscriptions
where subscription.Expires > DateT
If you don't mind querying the database before every use, I would suggest the following workaround: Use ExecuteQuery in one place to get the date in the data context like this:
public partial class YourDataContext
{
public DateTime GetDate()
{
return ExecuteQuery("SELECT GETDATE()").First();
}
}
and then you can write
from subscription in dbContext.Subscriptions
where subscription > dbContext.GetDate().AddDays(2)
select subscription