creating an alias for a function name in C#
问题 I want to create an alias for a funcion name in C#. Is there any way but function overloading? public class Test { public void A() { ... } } I want to call B replace A same below. var test = new Test(); test.B(); 回答1: You can use an extension method public static class Extensions { public static void B(this Test t) { t.A(); } } But it is not an alias. It is a wrapper. EDIT ps: I agree with the commenters on your question that we'd be able to give better answers if we knew what you really