Class CollectionExtensions
- Assembly
- Cuemon.Extensions.Collections.Generic.dll
Extension methods for the ICollection<T> interface.
public static class CollectionExtensions
- Inheritance
-
CollectionExtensions
Methods
AddRange<T>(ICollection<T>, T[])
Adds the elements of the specified source
to the collection
.
public static void AddRange<T>(this ICollection<T> collection, params T[] source)
Parameters
collection
ICollection<T>The ICollection<T> to extend.
source
T[]The sequence of elements that should be added to
collection
.
Type Parameters
T
The type of elements in the ICollection<T>.
AddRange<T>(ICollection<T>, IEnumerable<T>)
Adds the elements of the specified source
to the collection
.
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> source)
Parameters
collection
ICollection<T>The ICollection<T> to extend.
source
IEnumerable<T>The sequence of elements that should be added to
collection
.
Type Parameters
T
The type of elements in the ICollection<T>.
ToPartitioner<T>(ICollection<T>, Int32)
Extends the specified collection
to support iterating in partitions.
public static PartitionerCollection<T> ToPartitioner<T>(this ICollection<T> collection, int partitionSize = 128)
Parameters
collection
ICollection<T>The ICollection<T> to extend.
partitionSize
Int32The size of the partitions.
Returns
- PartitionerCollection<T>
An instance of PartitionerCollection<T>.
Type Parameters
T
The type of elements in the
collection
.