Equivalent of SQL Between Statement Using Linq or a Lambda expression

前端 未结 3 1575
南笙
南笙 2020-12-09 11:36

Don\'t think this is a repost, difficult to search for the word between because it is used in everything (like searching for AND).

I want to filter a list based on a

3条回答
  •  Happy的楠姐
    2020-12-09 11:56

    var query = from l in list
            where new DateTime(1,1,2010) <= l.DateValue and DateValue <= new DateTime(1,1,2011)
            select l;
    

    of course, normally warning about timezones and different times on clients and servers apply

提交回复
热议问题