How can I use Expression
to set properties on an instance of an object I already have? I don't want to create a new object, so Expression.New
where you can pass in member initializers won't work.
This is not a duplicate of How to set property value using Expressions? because that takes an Expression
and sets properties via Reflection
.
I have an existing object
and want to create an Expression
where I can set properties. That expression will then get compiled into a delegate
to execute.