什么是防爆pression树木和你如何使用它们,为什么要使用它们? [英] What are Expression Trees and how do you use them and why would you use them?

查看:162
本文介绍了什么是防爆pression树木和你如何使用它们,为什么要使用它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚碰到我听过多次EX pression树的概念。我只是想了解什么是由前pression树,其目的意思。

I just came across the concept of expression trees which I have heard multiple times. I just want to understand what is meant by an expression tree and its purpose.

我会喜欢它,如果有人也直接我简单的解释使用和样品。

I would love it if someone could also direct me to simple explanations and samples of use.

推荐答案

这是前pression树是一种数据结构,包含前pressions,这基本上是code。所以这是一个树状结构,具有code。在它的一部分。这些作品的code然后可以通过运行前pression树了一组数据来执行。

An Expression Tree is a data structure that contains Expressions, which is basically code. So it is a tree structure with pieces of code in it. These pieces of code can then be executed by "running" the expression tree over a set of data.

有关EX pression树伟大的事情是,你可以在code建立起来;也就是说,你建立可执行code(或一系列步骤)的在code 的。您也可以修改code您通过其他前pressions更换前pressions执行它。

A great thing about expression trees is that you can build them up in code; that is, you build executable code (or a sequence of steps) in code. You can also modify the code before you execute it by replacing expressions by other expressions.

这是前pression是那么功能委托,如(INT X =>返回X * X)。

An Expression is then a function delegate, such as (int x => return x * x).

另请参见<一个href="http://blogs.msdn.com/b/charlie/archive/2008/01/31/ex$p$pssion-tree-basics.aspx">http://blogs.msdn.com/b/charlie/archive/2008/01/31/ex$p$pssion-tree-basics.aspx

这篇关于什么是防爆pression树木和你如何使用它们,为什么要使用它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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