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替换

原文地址:https://www.cnblogs.com/chenjianxiang/p/4984174.html