'.NET Expressions - Property Initializers

I'm trying to find an example of how, with the .NET Expression library, to new up an object and assign properties using property initializers. Does anyone have an example of this?

Basically, I need Expression code equivalent to:

new Foo() { Bar = "bar", Baz = 5 }

I have Expression.New(constructorInfo) so far but I'm not sure how to add the property initializers.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source