How to mutate a boxed struct using IL

后端 未结 5 1062
执笔经年
执笔经年 2020-12-24 07:41

Imagine we have a mutable struct (yes, don\'t start):

public struct MutableStruct
{
    public int Foo { get; set; }
    public override string          


        
5条回答
  •  感动是毒
    2020-12-24 08:19

    I've posted a solution using Expression Trees for setting fields in another thread. It's trivial to change the code to use properties instead:

提交回复
热议问题