开发者

Dynamic Linq to Entities...querying date fields

I am trying to use Linq to Entities with the Linq.Dynamic library (via Scott Guthrie) and I'm having some strange issues with querying dates.

var _date1 = DateTime.Now.AddDays(30).Date;
var _date2 = DateTime.Now.AddDays(31).Date;
var dateField = "DUEDATE";

docs = db.DOCUMENT.Where("@0 >= @1", dateField, _date1).Where("@0 <= @1", dateField, _date2);

This return no results, when it definitely should... 开发者_运维技巧it's simply a between statement to grab records for the specified day, but LinqToEntities doesn't like the combo. Any ideas??

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜