IRegion TKey, TValue  TryGetValue Method (TKey, TValue )Pivotal GemFire .NET Client Documentation
Gets the value associated with the specified key.

Namespace: GemStone.GemFire.Cache.Generic
Assembly: GemStone.GemFire.Cache (in GemStone.GemFire.Cache.dll) Version: 8.0.0.0
Syntax

bool TryGetValue(
	TKey key,
	ref TValue value
)

Parameters

key
Type: TKey
The key whose value to get.
value
Type: TValue 
When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Return Value

true if the object that implements IDictionary contains an element with the specified key; otherwise, false.

Implements

IDictionary TKey, TValue  TryGetValue(TKey, TValue )
Exceptions

ExceptionCondition
[!:IllegalArgumentException] if key is null
[!:CacheLoaderException] if CacheLoader throws an exception
[!:CacheServerException] If an exception is received from the Java cache server. Only for Native Client regions.
[!:NotConnectedException] if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException.
[!:MessageException] If the message received from server could not be handled. This will be the case when an unregistered typeId is received in the reply or reply is not well formed. More information can be found in the log.
System TimeoutException if the operation timed out
[!:RegionDestroyedException] if this region has been destroyed
See Also