public IActionResult Post([FromBody] Promotorias promotorias) { try { _promotoriasRepository.Insert(promotorias); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult Put([FromBody] Promotorias promotorias, int id) { try { if (id > 0 && id == promotorias.ID) { _promotoriasRepository.Update(promotorias); } else { return(BadRequest("Informe o id")); } return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }