Method AddRange
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the List<T>
Declaration
void AddRange(IEnumerable<T> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | The collection whose elements should be added to the end of the List<T> |
Examples
The following code sample shows how to add multiple of items to distributed list.
ICache cache = CacheManager.GetCache("myCache");
string dataTypeName = "DistributedList";
IDistributedList<Product> list = cache.DataTypeManager.GetList<Product>(dataTypeName);
// Get new products
Product[] newProducts = FetchNewProducts();
list.AddRange(newProducts);