实体框架6数据库功能不可用 [英] entity framework 6 dbfunctions not available
问题描述
我在DAL类库中安装了EF 6,但是当我添加对System.Data.Entity的引用并构建解决方案时,仍可以使用DbFunctions.TruncateTime,它仍然显示消息:类型或名称空间名称'DbFunctions'命名空间 System.Data.Entity中不存在(您是否缺少程序集引用?)。
I installed EF 6 in a DAL class library but I can get it work DbFunctions.TruncateTime, when I add the reference to System.Data.Entity and build the solution still appearing the message: The type or namespace name 'DbFunctions' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?) .
帮助...我需要比较日期!!!
Help... I need to compare dates !!!
推荐答案
我认为dbfunctions实际上驻留在EntityFramework.dll中,添加对EntityFramework的引用,您应该是对的。
I think the dbfunctions actually reside in EntityFramework.dll, add a reference to EntityFramework and you should be right.
https://msdn.microsoft.com/en-us/library/system.data.entity.dbfunctions%28v=vs.113%29.aspx
这里的程序集也是实体框架。
States in here the assembly is entityframework too.
这篇关于实体框架6数据库功能不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!