Phil5780
asked on
C# Interface parent class
I have a single object which can be derived from 3 separate classes. This derived object is then passed as a parameter into another class method. How do I determine which parent class owned my parameter?
Please refer to the code below:
Please refer to the code below:
DriverFord myFord = new DriverFord();
DriverChevy myChevy = new DriverChevy();
DriverHonda myHonda = new DriverHonda();
CarWheel myWheel = new CarWheel();
myWheel = myFord.GetWheel; //I created a Ford wheel object
SomeClass.SomeMethod(myWheel); //How do I determine whether that wheel came from a Ford, Chevy, or Honda object?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Type parameterType = oHandlerResponse.Data.GetT ype();
ASKER
Got it! By using the Type.Name I was able to nail down who the parent is. Thanks!