Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top