Dynamic LINQ DateTime Comparison String Building - Linq To Entities

前端 未结 5 1361
慢半拍i
慢半拍i 2020-12-19 04:54

I\'m using the dynamic LINQ library by Scott Guthrie together with Entity Framework and C#.

I have to build my where string into a variable based on several factors

5条回答
  •  死守一世寂寞
    2020-12-19 05:56

    I was able to get it working with a slightly different string format using the information here.

    Doing this worked fine for me:

    ContactList.Where("DateAdded >= DateTime(2013, 06, 18)")
    

    Note this does not work at all with DateTimeOffset columns.

提交回复
热议问题