I am using C# 4.0, how can I avoid the problem of writing lots of similiar methods because they are each parameter-unique (how can the new parameter features avoid overload hell?).
Thanks
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.
Instead of this:
You can just have one method with all the params you want, and call it using the named params like this:
And call it like this:
Just include what you want to set, the rest will be the defaults you specified in the method signature.