我有一个类 A,它实现了接口 I:
class A: I
{
// implementation of I
}
还有另一个接口 J,它扩展了 I:
interface J : I
{
// J methods and properties.
}
我想发出一个动态类 B,它看起来像这样:
class B : A, J
{
// All the constructors of A
// All the methods of J, which are not implemented by A. Their implementation would just throw NotImplementedException()
}
我在 Reflection.Emit 方面有足够的知识,可以从头开始,但是,唉,我真的不希望这样做。有谁知道图书馆,可以做到这一点?
谢谢。
附言
我知道 Castle 项目,但从未真正使用过它,也不知道他们是否有适合我的现成解决方案。