Method AddRange
AddRange(IEnumerable<T>)
Insert elements of the provided collection in IDistributedSet.
Declaration
void AddRange(IEnumerable<T> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | Elements to be inserted in the IDistributedSet. |
Examples
The following code sample shows how to add multiple of items in distributed set.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedSet";
IDistributedHashSet<int> set = cache.DataTypeManager.GetHashSet>int>(dataTypeName);
// Create array of userIDs
int[] userIDs = new int[3] { 1223, 3564, 4545 };
set.AddRange(userIDs);