public List <T> RetrieveByState <T>(BaseEntity entity) { var lstCategory = new List <T>(); var lstResult = dao.ExecuteQueryProcedure(mapper.GetRetriveByStateStatement(entity)); var dic = new Dictionary <string, object>(); if (lstResult.Count > 0) { var objs = mapper.BuildObjects(lstResult); foreach (var c in objs) { lstCategory.Add((T)Convert.ChangeType(c, typeof(T))); } } return(lstCategory); }