示例#1
0
        public override List <T> RetrieveAll <T>()
        {
            try
            {
                var      lstResult = SqlDao.ExecuteQueryProcedure(_mapper.GetRetrieveByallStatement());
                var      dic       = new Dictionary <string, object>();
                List <T> lista     = new List <T>();

                if (lstResult.Count > 0)
                {
                    for (int i = 0; i < lstResult.Count; i++)
                    {
                        dic = lstResult[i];
                        var objs = _mapper.BuildObject(dic);

                        lista.Add((T)Convert.ChangeType(objs, typeof(T)));
                    }
                    return(lista);
                }
                return(default(List <T>));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }