A nice VB statement is IF(). It’s equivalent to the C# ?? operator. It works like this:

Dim i as integer? = Nothing
Console.WriteLine(IF(i, –1))
i = 3
Console.WriteLine(IF(i, –1))

The above will output:
-1
3

The IF() statement evaluates the nullable variable. If it is not null, then it will return the value of the variable. Otherwise, it returns the value of the second parameter.

The equivalent in C# would be:

int? i = null;
Console.WriteLine(i ?? -1);
i = 3;
Console.WriteLine(i ?? -1);

The above will also output:
-1
3