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:

bool TryGetValue(
	TKey key,
	ref TValue value


Type: TKey
The key whose value to get.
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.


IDictionary TKey, TValue  TryGetValue(TKey, TValue )

[!: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