EntityFramework6 版本更变产生的错误

LINQ to Entities does not recognize the method 'System.Nullable`1[System.Int32] DiffMinutes(System.Nullable`1[System.DateTime], System.Nullable`1[System.DateTime])' method, and this method cannot be translated into a store expression.


解决:EntityFunctions.DiffMinutes method在EntityFramework6中已改成DbFunctions.DiffMinutes,所以不要引入using System.Data.Objects,换成引入using System.Data.Entity替换

 

posted @ 2015-11-21 17:13  chen2013  阅读(436)  评论(0编辑  收藏  举报