首页 > 其他 > 详细

The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties

时间:2015-11-14 22:04:59      阅读:311      评论:0      收藏:0      [点我收藏+]

出现这个错误提示可以用 DbFunctions.TruncateTime 将Linq中entity的DateTime转化一下再使用,如下所示:

var anyCalls = _db.CallLogs.Where(x => DbFunctions.TruncateTime(x.DateTime) == callDateTime.Date).ToList();

更多详细解答请看如下链接:

http://stackoverflow.com/questions/14601676/the-specified-type-member-date-is-not-supported-in-linq-to-entities-only-init 

 

Date vs DateTime

http://stackoverflow.com/questions/798121/date-vs-datetime 

 

The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties

原文:http://www.cnblogs.com/mingmingruyuedlut/p/4965129.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!