Adds the elements of the specified collection to the end of the . The type of elements in the collection. The to add items to. The collection whose elements should be added to the end of the . It can c
(this ICollection<T> destination, IEnumerable<T> collection)
| 89 | /// <param name="collection">The collection whose elements should be added to the end of the <paramref name="destination"/>. It can contain elements that are <see langword="null"/>, if type <typeparamref name="T"/> is a reference type.</param> |
| 90 | /// <exception cref="ArgumentNullException">If <paramref name="destination"/> or <paramref name="collection"/> are <see langword="null"/>.</exception> |
| 91 | public static void AddRange<T>(this ICollection<T> destination, IEnumerable<T> collection) |
| 92 | { |
| 93 | if (destination == null) |
| 94 | throw new ArgumentNullException(nameof(destination)); |
| 95 | if (collection == null) |
| 96 | throw new ArgumentNullException(nameof(collection)); |
| 97 | foreach (var item in collection) |
| 98 | { |
| 99 | destination.Add(item); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | /// <summary> |
| 104 | /// Enqueues the elements of the specified collection to the <see cref="Queue{T}"/>. |
no test coverage detected