Parametrized queries
Hi
Can I build "parametrized" queries with LINQPad?
I tried to do something like that:
Thanks in advance
Philippe
Can I build "parametrized" queries with LINQPad?
I tried to do something like that:
(As I cannot use the expression directly in my query)
var date = DateTime.Now.AddDays(3); // Parameter
from dvd in Dvds.Where(d => d.Date != date)
...
Thanks in advance
Philippe
Comments
Given that you're using the != operator, I'm guessing you want to match on just the date portion and not the time of day. So your query should look like this:
var date = DateTime.Now.AddDays(3).Date; // Parameter
var query = from dvd in Dvds.Where(d => d.Date.Date != date) ...
Awesome.