In C# I have a base class and a derived class.
I have a function which has the base class as an input parameter
public void SomeFunction(BaseClass InstanceOfDerivedClass)
Is there a way I can access the properties specific to the derived class, even though it has been passed as a base class? Could I use GetType or Cast or something like that?
I appreciate that the solutions may not be elegant but at the moment the alternative is to repeat this function many times for the different derived classes.
you could do this (bad way):
Or, as suggested by Eric (good way):