How can we declare Optional Parameters in C#.net? [duplicate]
This question already has an answer here: Can I give a default value to parameters or optional parameters in C# functions? 6 answers I am using a method for doing some action, i want the method to be written only once by using Optional Parameters in C#, other than Method Overloading is there any? New to visual studio 2010 named and optional arguments for example public void ExampleMethod(int required, string optionalstr = "default string", int optionalint = 10) { } Have a look at following code Library to use using System.Runtime.InteropServices; Function declaration private void