public override T Retrieve <T>(Entity entity) { var lstResult = dao.ExecuteQueryProcedure(mapper.GetRetrieveStatement(entity)); var dic = new Dictionary <string, object>(); if (lstResult.Count > 0) { dic = lstResult[0]; var objs = mapper.BuildObject(dic); return((T)Convert.ChangeType(objs, typeof(T))); } return(default(T)); }
public override T Retrieve <T>(BaseEntity entity) { var lstResult = dao.ExecuteQueryProcedure(_mapper.GetRetriveStatement(entity)); if (lstResult.Count <= 0) { return(default(T)); } var dic = lstResult[0]; var objs = _mapper.BuildObject(dic); return((T)Convert.ChangeType(objs, typeof(T))); }
public override T Retrieve <T>(string cedula) { try { var lstResult = SqlDao.ExecuteQueryProcedure(_mapper.GetRetriveByIdStatement(cedula)); var dic = new Dictionary <string, object>(); if (lstResult.Count > 0) { dic = lstResult[0]; return((T)Convert.ChangeType(_mapper.BuildObject(dic), typeof(T))); } return(default(T)); } catch (Exception ex) { //Administrar Conexion Data Base AdministrarExcepcion(ex); throw ex; } }