// GET: api/TipoNomina/5 public IHttpActionResult Get(string id) { try { IEnumerable <TipoNomina> list = ServicioTNM.Find(id); return(Ok( list.FirstOrDefault() ?? new TipoNomina() )); } catch (Exception) { return(BadRequest()); } }
// POST: api/TipoNomina public IHttpActionResult Post([FromBody] TipoNominaDTO value) { try { ServicioTNM.Agregar(value.Tipo, value.Descripcion); return(Ok( new { Description = "Todo bien" } )); } catch (Exception) { return(BadRequest()); } }
// GET: api/TipoNomina public IHttpActionResult Get() { try { IEnumerable <TipoNomina> list = ServicioTNM.Find(null); return(Ok( list )); } catch (Exception) { return(BadRequest()); } }