是什么EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法之间的区别是什么? [英] What are the difference between EntityFunctions.TruncateTime and DbFunctions.TruncateTime methods?

查看:2444
本文介绍了是什么EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是有什么区别:

  EntityFunctions.TruncateTime
 

  DbFunctions.TruncateTime方法?
 

解决方案

没有区别。 EntityFunctions 是出现在被内置于.​​NET框架(最多通过.NET 4.5),实体框架的版本的类。该 DbFunctions 类中引入实体框架6是从.NET框架单独提供。 对于开始6.0使用EF版本的任何新的应用程序,你应该使用 DbFunctions 类,如其他类(和许多内置的EF库)已过时赞成单独部署的版本。

这两个函数是翻译成实体框架模型中的基本规范功能,并最终转换成SQL调用仅仅是代理的电话。

What are are the difference between:

EntityFunctions.TruncateTime

and

DbFunctions.TruncateTime methods?

解决方案

There is no difference. EntityFunctions is the class that appears in the versions of the Entity Framework that are built in to the .NET Framework (up through .NET 4.5). The DbFunctions class was introduced in Entity Framework 6 that is shipped separately from the .NET Framework. For any new applications using versions of EF starting with 6.0, you should use the DbFunctions class, as the other class (and much of the built-in EF library) has been obsoleted in favor of the separately deployed versions.

Both functions are merely proxy calls that are translated into the underlying canonical functions within the Entity Framework model and, eventually, into SQL calls.

这篇关于是什么EntityFunctions.TruncateTime和DbFunctions.TruncateTime方法之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆