why datetime.now not work when I didn't use tolist?

Posted by MemoryLeak on Stack Overflow See other posts from Stack Overflow or by MemoryLeak
Published on 2010-06-17T11:15:59Z Indexed on 2010/06/17 11:23 UTC
Read the original article Hit count: 224

Filed under:
|
|

When I use

datacontext.News
    .Where(p => p.status == true)
    .Where(p => p.date <= DateTime.Now)
    .ToList();

the system will return no results;

When I use

datacontext.News
    .Where(p => p.status == true)
    .ToList()
    .Where(p => p.date <= DateTime.Now)
    .ToList();

system will return expected results. Can anyone tell me what's up?

Thanks in advance !

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about LINQ