Why would you use Expression> rather than Func?

后端 未结 10 1998
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 00:32

I understand lambdas and the Func and Action delegates. But expressions stump me.

In what circumstances would you use an Expression

10条回答
  •  鱼传尺愫
    2020-11-22 00:58

    You would use an expression when you want to treat your function as data and not as code. You can do this if you want to manipulate the code (as data). Most of the time if you don't see a need for expressions then you probably don't need to use one.

提交回复
热议问题