IRegion TKey, TValue  Remove Method (KeyValuePair TKey, TValue )Pivotal GemFire .NET Client Documentation
Removes a key and value from the dictionary.

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

bool Remove(
	KeyValuePair<TKey, TValue> keyValuePair


Type: System.Collections.Generic KeyValuePair TKey, TValue 
The KeyValuePair structure representing the key and value to remove from the Dictionary.

Return Value

true if the key and value represented by keyValuePair is successfully found and removed; otherwise, false. This method returns false if keyValuePair is not found in the ICollection.

Return Value

true if entry with key and its value are removed otherwise false.

[!: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.
System TimeoutException if the operation timed out
[!:RegionDestroyedException] if this region has been destroyed

Remove removes not only the value, but also the key and entry from this region.

The Remove is propogated to the Gemfire cache server to which it is connected with.

Does not update any CacheStatistics.

The comparison of the value of the key value pair depends on the Equals function of the TValue class. If the Equals function is not overriden in the TValue class the behavior of this function is undefined. Hence, this function won't work properly for the .NET types that uses the default implementation of the Equals method, for e.g. arrays.

See Also