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

 

posted on 2020-07-04 16:06  红磨坊后的白桦树  阅读(166)  评论(0编辑  收藏  举报