Hi folks,
the following lambda statemement returns null, when i was hoping it would return a string value.
var countryCode = AddressComponents
.Where(x => x.AddressType == AddressType.Country)
.Select(x => x.ShortName)
.SingleOrDefault();
now the AddressType property of the current instance i'm interrigating contains the following data:
AddressType.Political | AddressType.Country
so it's containing TWO values.
Of course, my lambda will not work, because the value of country (lets assume it's 1) != the value of Political bitwise or Country (lets assume it's 1 | 2 == 3).
Any ideas?
I'm worried i need to have something really fraking ugly like ...
((AddressTypes & AddressType.Country) == AddressType.Country)
.. thoughts?