public BaseResponse <Carreras> GetCarrera(int IdCarrera) { var response = new BaseResponse <Carreras>(); try { response.Results = _CarrerasDAL.GetCarreras(IdCarrera); if (response.Results != null) { response.CodeError = 0; } else { response.SetErrorCode(7); } } catch { throw; } return(response); }
public IHttpActionResult GetCarreras() { List <Carrera> lstCarreras = carreras.GetCarreras(); if (lstCarreras.Count > 0) { if (!String.IsNullOrEmpty(lstCarreras[0].mensajeError)) { return(Content(HttpStatusCode.NotFound, lstCarreras[0].mensajeError)); } else { return(Content(HttpStatusCode.OK, lstCarreras)); } } else { return(Content(HttpStatusCode.OK, lstCarreras)); } }