Passing IList to Collection

I need to send IList

to Collection

( System.Collections.ObjectModel

)

How do you do it?

+2


a source to share


2 answers


Collection<MyClass> coll = new Collection<MyClass>(myIList);

      



+7


a source


Just use the constructor:



IList<T> myList = ...
System.Collections.ObjectModel.Collection<T> omc = 
           new System.Collections.ObjectModel.Collection<T>(myList);

      

+4


a source







All Articles