Try Playground
Show / Hide Table of Contents

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("demoClusteredCache");
string dataTypeName = "DistributedSet";

IDistributedHashSet<int> set = cache.DataTypeManager.GetHashSet>int>(dataTypeName);

int result = set.RemoveRandom();
Back to top Copyright © 2017 Alachisoft