Last post Sep 19, 2016 02:49 PM by senthilwaits
Sep 19, 2016 01:55 PM|tvb2727|LINK
What is the best way to resolve this issue with Truncate time function that I was using in EF 4.0?
Exception type: System.NotSupportedException
Exception message: LINQ to Entities does not recognize the method 'System.Nullable`1[System.DateTime] TruncateTime(System.Nullable`1[System.DateTime])' method, and this method cannot be translated into a store expression.
Sep 19, 2016 02:49 PM|senthilwaits|LINK
If you migrated from EF4 to EF6, you have to remove the reference "System.Data.Entity" DLL. EF6 is not part of .NET Framework and it is independent of "System.Data.Entity". You need to use "System.Data.Entity.DbFunctions.TruncateTime"
from EntityFramework DLL.
Try replace EntityFunctions.TruncateTime with System.Data.Entity.DbFunctions.TruncateTime