Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
 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));
     }
 }