tags:

views:

28

answers:

2

Hi there i am creating some classes and methods for my project so that it can be used over and over

now the problem is this that is has lots of functions in these dlls. i want to give them some name as alias name so that user can easily find and call these function as per their requirements ..

is there any way to call a function with two or more name . if any one please give me ans....

Thanks

A: 

Do the functions need to be overridable?

If not just have another function call the alias that calls the main function.

MikeG
+1  A: 

In what language?

In C#, creating an alias to a method is as easy as:

public class Demo
{
    public int SomeMethodHere(string argument)
    {
        // Code here.
    }

    public int AliasToSomeMethod(string argument)
    {
        return this.SomeMethodHere(argument);
    }
}
MainMa
Hi thanks for response but i need a way by which i dont need to create any function to call another function.
J S Jodha
@J S Jodha: I don't think there is a way to do it in C# (how the caller of an alias will know that this alias exist?). You may probably find a way to do it through Reflection or, in .NET Framework 4.0, dynamic, but at what performance cost?
MainMa