I want to ask, does adding extension methods to datatypes works in the same way as Microsoft’s methods or do they have any limitaion.
This is relevant to experienced programmers who had find some limitations while using them.
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.
What sort of limitations are you thinking of? I’m not particularly fond of the way they’re discovered – and in particular, the way that if the extended type later gains a method with the same signature, that will silently be called with no warnings around the extension method at all.
There are some ways in which they don’t work as well as one might like – for example, you can’t write an extension method for a delegate type and call it directly on a lambda expression or anonymous method – but that’s reasonable enough.
Beyond that, I’m not aware of significant limitations – and I certainly haven’t seen any situations where Microsoft code has had special rules applied around extension methods.
Your last sentence makes it sound like you have seen some limitations – could you share them with us?