I was wondering how in C# could I declare and use a method that can take in as an argument a base class as well as any children classes derived from the base class?
thank you
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 put type of base class as parameter but this is asking for trouble. If you going to access base class memebers you need to really understand what you do.
This type of task usually handled using interfaces.