[英]what are 'EdmFunctions' for?
i saw the System.Data.Common.CommandTrees.ExpressionBuilder.EdmFunctions
static class accidently, that contains a set of extension methods on System.Data.Common.CommandTrees.DbExpression
, like AddDays, Concat,.... which bring back System.Data.Common.CommandTrees.DbFunctionExpression
as return type, this static methods if needs to an argument, they only accept a System.Data.Common.CommandTrees.DbExpression
type, in addition i look over the System.Data.Common.CommandTrees.DbExpression
and i saw this class is abstract and by its static members you can create a System.Data.Common.CommandTrees.DbExpression
, and send them to System.Data.Common.CommandTrees.ExpressionBuilder.EdmFunctions
to use its extension methods, 我偶然看到了
System.Data.Common.CommandTrees.ExpressionBuilder.EdmFunctions
静态类,该类包含System.Data.Common.CommandTrees.DbExpression
上的一组扩展方法,例如AddDays,Concat等System.Data.Common.CommandTrees.DbFunctionExpression
作为返回类型,此静态方法如果需要一个参数,则仅接受System.Data.Common.CommandTrees.DbExpression
类型,此外我还要查看System.Data.Common.CommandTrees.DbExpression
我看到了这个类是抽象的,并且可以通过其静态成员创建System.Data.Common.CommandTrees.DbExpression
,并将其发送到System.Data.Common.CommandTrees.ExpressionBuilder.EdmFunctions
以使用其扩展方法,
my questions are: 我的问题是:
canonical functions
and are as helper method for using in Linq
, like System.Data.Objects.EntityFunctions
's methods or System.Data.Objects.SqlClient.SqlFunctions
's Methods ? canonical functions
并且可以作为在Linq
使用的辅助方法,例如System.Data.Objects.EntityFunctions
的方法或System.Data.Objects.SqlClient.SqlFunctions
的方法? whereas there is a attribute with name System.Data.Metadata.Edm.EdmFunction
and by this, you can create CLR
functions and map them to created model-defined functions
for using in Linq
, 而有一个名称为
System.Data.Metadata.Edm.EdmFunction
的属性,通过此属性,您可以创建CLR
函数并将其映射到创建的model-defined functions
,以供在Linq
使用,
could you attach any sample? 你能附上样品吗? or link to any documentaion?
或链接到任何文献资料?
These methods are not meant for general consumption, you continue to use SqlFunctions
or EntityFunctions
in client code. 这些方法不适合一般使用,您可以继续在客户端代码中使用
SqlFunctions
或EntityFunctions
。 They are the stock implementations of the canonical functions that can execute on an arbitrary provider. 它们是可以在任意提供程序上执行的规范功能的常规实现。 Microsoft includes the providers for XML, BCL collections and Entity SQL.
Microsoft包括XML,BCL集合和Entity SQL的提供程序。 Somebody else can create a provider to, say, their own dbase engine or ORM.
其他人可以为他们自己的dbase引擎或ORM创建提供程序。
The mapping from, say, EntityFunctions.AddDays()
to EdmFunctions.AddDays()
occurs dynamically when the query comprehension is executed. 当执行查询理解时,从
EntityFunctions.AddDays()
到EdmFunctions.AddDays()
的映射会动态发生。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.