Create type “MyClass : OtherClass { }” at runtime?

后端 未结 3 769
灰色年华
灰色年华 2021-01-02 09:48

Is it possible in C# to create a type at runtime that inherits from a generic class where the template parameter for the base class is the current class being constructed? T

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-02 09:56

    You can set the base type afterwards.

    TypeBuilder.SetParent(Type)

提交回复
热议问题