TryGetValue method

bool TryGetValue(
  1. PhoneNumberKey key,
  2. OutParam<String> phoneNumberOutParam
)
Tries to get the phone number associated with the specified key. The key. When this method returns, contains the phone number associated with the specified key, if the key is found; otherwise, null. This parameter is passed uninitialized.

Implementation

bool TryGetValue(PhoneNumberKey key, OutParam<String> phoneNumberOutParam) {
  PhoneNumberEntry? entry = null;

  if (this.Entries.containsKey(key)) {
    phoneNumberOutParam.param = entry!.PhoneNumber;
    return true;
  } else {
    phoneNumberOutParam.param = null;
    return false;
  }
}