I have a class Customer which contains the property Extensions which in turn contains the property Any.
I tried to do:
Dim room = If(customer.Extensions.Any.ElementAt(0).InnerText, Nothing)
but it threw an error when it did not find an Extension element in the incoming xml. I thought it would return nothing once it saw that the first expression was Nothing. Do I have to do a multiple if statement in this case?
Yes, you do have to check for at least one element. So what you could do would be:
Depending on the type of
customer.Extensions.Any, you could do this: