MSDN documentation indicates the the class Collection<T>
has a method ToList()
in the Extension section.
How I can use this method?
This documentation is a bit misleading. The type Collection<T>
doesn't have this method directly. Intstead it's defined as an extension method on System.Linq.Enumerable
. Adding the using
directive for System.Linq
should fix the problem
using System.Linq;
...
Collection<T> col = ...;
List<T> list = col.ToList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With