/// <summary>
        /// Convertir el DataReader y la convierte en una lista del tipo <typeparamref name="T"/>
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="reader"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public virtual IEnumerable <T> ConvertirLoteDataReader <T>(IDataReader reader, HttpContextBase context) where T : CatalogoModel, new()
        {
            IEnumerable <SerieModel>   seriesList   = new SeriesDataService().ObtenerSeries(null, null, context);
            IEnumerable <MateriaModel> materiasList = new MateriasDataService().ObtenerMaterias(null, null, context);
            List <T> modelos = new List <T>();
            DataSet  ds      = ((ExcelDataReader.IExcelDataReader)reader).AsDataSet(new ExcelDataSetConfiguration()
            {
                ConfigureDataTable = (rowReader) =>
                                     new ExcelDataTableConfiguration()
                {
                    UseHeaderRow = true
                }
            });

            using (DataTableReader dsReader = ds.Tables[0].CreateDataReader())
                modelos = this.FillCatalogoListExcel <T>(dsReader, new SeriesDataService(), seriesList, new MateriasDataService(), materiasList, false, context);
            //this.InsertarLote(modelos, context);
            return(modelos);
        }
        protected virtual List <T> FillCatalogoListExcel <T>(IDataReader reader, SeriesDataService serieDs, IEnumerable <SerieModel> seriesList, MateriasDataService materiaDs, IEnumerable <MateriaModel> materiasList, bool limitarStrings, HttpContextBase context) where T : CatalogoModel, new()
        {
            List <T> result = new List <T>();
            long     count  = 0;

            while (reader.Read())
            {
                T nc = new T();
                //--------------------------\\
                nc.Contenido = Convert.IsDBNull(reader["Contenido"]) ? null : reader["Contenido"].ToString();
                nc.Año       = Convert.IsDBNull(reader["Año"]) ? (short?)null : Convert.ToInt16(reader["Año"]); //Año
                nc.Fecha     = Convert.IsDBNull(reader["Fecha"]) ? (DateTime?)null : (DateTime)reader["Fecha"];
                nc.Folio     = Convert.IsDBNull(reader["Folio"]) ? null : reader["Folio"].ToString();

                if (seriesList.Count() > 0)
                {
                    SerieModel serie = seriesList.FirstOrDefault(sm => sm.Nombre.Trim().Equals(reader["Series"].ToString().Trim()));
                    if (serie == null)
                    {
                        serie = new SerieModel()
                        {
                            Nombre = reader["Series"].ToString()
                        };
                        serieDs.Insertar(serie, context);
                    }
                    nc.IdSerie      = serie?.ID;
                    nc.SeriesNombre = serie?.Nombre;
                }

                if (materiasList.Count() > 0)
                {
                    string materiaExt = Convert.IsDBNull(reader["Materias"]) ? null : reader["Materias"].ToString();
                    if (!string.IsNullOrEmpty(materiaExt))
                    {
                        nc.ListaMaterias = new List <MateriaModel>();
                        string[] valoresSeparados = null;
                        if (materiaExt.Contains(" / "))
                        {
                            valoresSeparados = materiaExt.Split(new string[] { " / " }, StringSplitOptions.RemoveEmptyEntries);
                        }
                        else
                        {
                            valoresSeparados = new string[] { materiaExt };
                        }
                        foreach (string item in valoresSeparados)
                        {
                            MateriaModel materia = materiasList.FirstOrDefault(m => m.Nombre.Trim().Equals(item.Trim()));
                            if (materia == null)
                            {
                                materia = new MateriaModel()
                                {
                                    Nombre = item
                                };
                                materiaDs.Insertar(materia, context);
                            }
                            nc.ListaMaterias.Add(materia);
                        }
                    }
                }

                nc.Libro         = Convert.IsDBNull(reader["Libro"]) ? (int?)null : Convert.ToInt32(reader["Libro"]);
                nc.Lugar         = Convert.IsDBNull(reader["Lugar"]) ? null : reader["Lugar"].ToString();
                nc.NumCaja       = Convert.IsDBNull(reader["Caja"]) ? null : reader["Caja"].ToString();
                nc.NumCarpeta    = Convert.IsDBNull(reader["Carpeta"]) ? (int?)null : Convert.ToInt32(reader["Carpeta"]);
                nc.NumExpediente = Convert.IsDBNull(reader["Expediente"]) ? null : reader["Expediente"].ToString();
                nc.NumTomo       = Convert.IsDBNull(reader["Tomo"]) ? (int?)null : Convert.ToInt32(reader["Tomo"]);
                nc.Observaciones = Convert.IsDBNull(reader["Observaciones"]) ? null : reader["Observaciones"].ToString();
                //nc.Materias = Convert.IsDBNull(reader["Materias"]) ? null : reader["Materias"].ToString();
                nc.Origen = 1;
                nc.ID     = count++;
                //--------------------------\\
                result.Add(nc);
            }
            return(result);
        }