Edit

Share via


CollectionExtensions.AddRange<T> Method

Definition

Adds the elements of the specified collection to the existing collection.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void AddRange(System::Collections::ObjectModel::Collection<T> ^ collectionToUpdate, System::Collections::Generic::IEnumerable<T> ^ collection);
public static void AddRange<T> (this System.Collections.ObjectModel.Collection<T> collectionToUpdate, System.Collections.Generic.IEnumerable<T> collection);
static member AddRange : System.Collections.ObjectModel.Collection<'T> * seq<'T> -> unit
<Extension()>
Public Sub AddRange(Of T) (collectionToUpdate As Collection(Of T), collection As IEnumerable(Of T))

Type Parameters

T

Type of item in the collection

Parameters

collectionToUpdate
Collection<T>

The existing collection.

collection
IEnumerable<T>

The collection of items to add.

Exceptions

Thrown when the collection parameter is null.

Applies to