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; }