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