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