Hi, I know how to make LINQ compiler extensions to translate properties/methods into SQL DOM. However, what I'd like to do is make a compiler that will allow me to use SQL SERVER's GETUTCDATE() in a query.
That should generate:
It would be even better if I could generate other dates relative to GETUTCDATE(). For example, if I wanted to query all customers created in the last 24 hours, the predicate would be CreatedOn >= [..].AddHours(-24) ... and this would be translated into CreatedOn >= DATEADD(HOUR, -24, GETUTCDATE()). I can't simply use the web server's DateTime.UtcNow because the web server's time often differs from the database server's. |