ICollection<T>转lsit

  List<ImportStudentDto> list = new List<ImportStudentDto>();
                        list = ToList<ImportStudentDto>(import.Data.ToList());
  public static List<T> ToList<T>(this IList In) where T : class
        {
            List<T> list = new List<T>();
            foreach (var i in In)
            {
                T t = i as T;
                if (t != null)
                {
                    list.Add(t);
                }
            }
            return list;
        }
原文地址:https://www.cnblogs.com/macT/p/13235226.html