예제 #1
0
        public override List <T> RetrieveByName <T>(BaseEntity entity)
        {
            var lst = new List <T>();

            try
            {
                var instance  = SqlDao.GetInstance();
                var lstResult = instance.ExecuteQueryProcedure(_mapper.GetRetriveByName(entity));

                if (lstResult.Count > 0)
                {
                    var objs = _mapper.BuildObjects(lstResult);

                    foreach (var obj in objs)
                    {
                        lst.Add((T)Convert.ChangeType(obj, typeof(T)));
                    }
                }
            }
            catch (Exception ex)
            {
                _exMan.ManageException(ex);
            }

            return(lst);
        }