I have class that wants an IList, but I have a Systems.Collection.IList, coming from an NHibernate quere.
IList
Systems.Collection.IList
I want to create a method th
If you're sure that all of the elements inherit from T (or whatever type you're using)
IList myList = nonGenericList.Cast().ToList();
If you're not sure:
IList myList = nonGenericList.OfType().ToList();
Of course, you will need the System.Linq namespace:
using System.Linq;