How to set a property of a C# 4 dynamic object when you have the name in another variable

后端 未结 5 616
独厮守ぢ
独厮守ぢ 2021-02-01 13:38

I\'m looking for a way to modify properties on a dynamic C# 4.0 object with the name of the property known only at runtime.

Is there a way to do something l

5条回答
  •  你的背包
    2021-02-01 14:08

    fast-member may fit the bill - it looks like it generates the IL on the fly, but caches it so it's really fast after the first use.

提交回复
热议问题