开发者

How can I create this Func?

Inspired 开发者_开发问答by:

NServiceBus.Configure.With().Log4Net(a => a.YourProperty = "value");

I want to use something similar as configuration, suggestions are welcome. My biggest problem is that I can't quite figure out how to use the parameter input...

What exactly is going on here? NServiceBus uses Log4Net, as instance? set with YourProperty = value?

Please abstract from the NServiceBus etc. I've just provided that as foundation for the discussion.


The lambda is creating an expression tree, which is not code but metadata about what the lambda shall do.

Therefore you can then "take apart" the lambda and see what properties, methods etc. would have been accessed on that instance (which never existed, since it is a definition only).

Google for "expression tree .net" and you'll find a lot of info on the topic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜