Nov 11

In VB.NET you have always been able to use optional parameters:

Sub Foo(ByVal p1 As String, Optional ByVal p2 As String = "default value")
End Sub

'Call to Foo with 1 of the 2 parameters is allowed
Foo("p1 value")

Now in C# 4.0 we get the same support:

void Foo(string p1, string p2 = "default value")
{
}

//Call to Foo with 1 of the 2 parameters is allowed
Foo("p1 value");

Continue reading »

Tagged with:
preload preload preload