How to use named and optional parameters in C#
Microsoft introduced support for named and optional parameters in C# 4.0. While a named parameter is used to specify an argument based on the name of the argument and not the position, an optional parameter can be used to omit one or more parameters in the method signature. The parameters of a method can be either required or optional depending on whether or not you need to pass a value to these parameters when the method is called.
It should be noted that named and optional parameters can be used not only with methods but also with indexers and delegates. This article discusses these two powerful features of the C# programming language and how we can work with them.