What is the point of having a dynamic class on which you can call methods that may, or may not be there?
Share
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.
The point is that you’ll usually be confident that the method will be present (or handled dynamically – e.g. a
FindByAuthormethod in a ‘book repository’ class which is translated into an appropriate SQL query) but that you don’t know the static type – or where the interfaces are fairly weakly typed (e.g. the Office COM APIs).I wouldn’t expect dynamic typing to be useful very often in C# – but when it’s handy, I suspect it’ll be very, very handy.