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();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use an extension method
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 wanted to do, if we understood the problem you’re trying to solve.
I don’t really see the point of producing the above extension method.