C# Optional Parameters

C# 4.0 introduces optional parameters to the language for methods, constructors, indexers and delegates.

Optional arguments can be defined within a member’s signature but omitted from calls to that member, in which case default values are used instead.

Often your source code will include several overloaded versions of one or more members. Sometimes the overloads will be created so that different types can be passed to, and returned from, a method. In these cases, the signatures of the overloads may differ significantly. However, it is common to create a number of overloaded versions of a member where each version simply … Click here to continue reading.