I had an API with methods and throughout the program I accessed the members of that API simply like:
Class API
{
public method1{}
public method3{}
}
API _api = new API(); // Inside constructor
_api.method1(); // I have accessed the api like this in so many places within my GUI
Now I got a new API with different methods and some overlaping:
Class new_API
{
public method2{}
public method3{}
}
My Question is how can I still keep a single api instantiation but instantiate different api classes?
API _api = new new_API() or new API();
FYI, this is the new path I'm taking after trying to just have one big class and hide the non common methods by passing extra parameter to the class instatiation: How to hide functions within classes in c#?
Thanks in Advance.