Method RemoveRandom
RemoveRandom()
Removes and returns a random element from the Set.
Declaration
T RemoveRandom()
Returns
Type | Description |
---|---|
T | Random element from the Set. |
Examples
The following code sample shows how to remove random element from a Distributed Set.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedSet";
IDistributedHashSet<int> set = cache.DataTypeManager.GetHashSet>int>(dataTypeName);
int result = set.RemoveRandom();