public IActionResult Post([FromBody] PolicyReferences PolicyReferences) { try { if (!ModelState.IsValid) { return(BadRequest()); } return(Ok(_unitOfWork.PolicyReferences.Insert(PolicyReferences))); } catch (Exception ex) { return(StatusCode(500, "Internal server error: " + ex.Message)); } }
public IActionResult Put([FromBody] PolicyReferences PolicyReferences) { try { if (ModelState.IsValid && _unitOfWork.PolicyReferences.Update(PolicyReferences)) { return(Ok(new { Message = "Datos de la referencia actualizados" })); } else { return(BadRequest()); } } catch (Exception ex) { return(StatusCode(500, "Internal server error: " + ex.Message)); } }