May 2010
Intermediate to advanced
1272 pages
61h 18m
English
If OperatorThe ternary If operator is generally used with lambda expressions and allows evaluating conditions on-the-fly. With this operator you can evaluate a condition and return the desired value either in case the condition is True or it is False. Imagine you have a Person class exposing both FirstName and LastName string properties and that you want to first verify that an instance of the Person class is not Nothing and, subsequently, that its LastName properties are initialized. The following code shows how you can accomplish the first task (see comments):

As you can see, the If operator receives three arguments: The first one ...
Read now
Unlock full access