// GET api/parametro/5 public IHttpActionResult Get(int id) { try { ServicioGenerico servicio = new ServicioGenerico(); Parametro resp = servicio.ParametroObtener(id); if (resp == null) { return(NotFound()); } return(Ok(resp)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult GetValor(string clave) { try { ServicioGenerico servicio = new ServicioGenerico(); //LoggerHelper.LogInfo(MethodBase.GetCurrentMethod(), string.Format("Parametro: {0} ", clave)); Parametro resp = null; if (clave != "VERSION_APP") { resp = servicio.ParametroObtener(clave); } //if (resp == null) // return NotFound(); return(Ok(resp)); } catch (Exception ex) { LoggerHelper.LogError(MethodBase.GetCurrentMethod(), ex); return(BadRequest(ex.Message)); } }