How to extend a method at runtime?
问题 Here is the class: class Foo { private void Boo() { // Body... } // Other members... } What I need is: Create a Foo2 class at runtime which has a copy of all Foo class members. In Foo2 class replace Boo method by Boo2 method that has its content alternated to some extent. Create an instance of Foo2 and invoke Boo2 . Thank you for help. 回答1: You can do it at runtime using a .NET AOP Framework event if it is not the the main purpose of this kind of framework. I actively work on a new one which