Dynamic LINQ DateTime Comparison String Building - Linq To Entities

前端 未结 5 1359
慢半拍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:40

    Based on Richard Rout's option, with a slight modification:

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

    This works in my Linq2Entities solution. Note the DateTime instead of Date. Hope this saves someone the headache this problem gave me.

提交回复
热议问题