Add Range of value to ICollection - CSharp System.Collections

CSharp examples for System.Collections:ICollection

Description

Add Range of value to ICollection

Demo Code

// of the GNU Public License, verison 2.
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from  w  w w  .j  a  v a 2  s . c  o m

public class Main{
        public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items)
        {
            foreach(var item in items)
                collection.Add(item);
        }
}

Related Tutorials