How do I use SQL's GETDATE() and DATEADD() in a Linq to SQL expression?

后端 未结 3 581
后悔当初
后悔当初 2020-11-27 15:51

If I have a Linq to SQL expression like this:

  from subscription in dbContext.Subscriptions
 where subscription.Expires > DateT         


        
3条回答
  •  隐瞒了意图╮
    2020-11-27 16:11

    You could use the ExecuteQuery to gain full control of the sql http://weblogs.asp.net/scottgu/archive/2007/08/27/linq-to-sql-part-8-executing-custom-sql-expressions.aspx

    I know it seems like very little gain (or perhaps on the contrairy) over ADO.NET though.

提交回复
热议问题