DJ *_*urb 3 c# linqpad dbfunctions
我试图在LinqPad(C#语句)中使用以下内容:
DbFunctions.TruncateTime(mvOutDt).ToString()
Run Code Online (Sandbox Code Playgroud)
似乎无法识别DbFunction。我添加了System.Data.Entity参考。我什至尝试使用来完全限定它System.Data.Entity.DbFunctions,但没有。
任何帮助表示赞赏。
您使用的版本不正确。
该DbFunctions班是在实体框架6,其通过NuGet包可推出。
如果您使用的是EF 5或更低版本,则根据文档,您将无法DbFunctions在System.Data.Entity名称空间中找到类。