Esempio n. 1
0
 public ActionResult <PerfilExamenDTO> Add([FromBody] PerfilExamenDTO perfilExamen)
 {
     try
     {
         perfilExamen.IdPerfilExamen = _perfilExamenAppService.GenerarCodigo();
         _perfilExamenAppService.Add(perfilExamen);
         _perfilExamenAppService.Save();
         return(CreatedAtAction(nameof(Add), new { id = perfilExamen.IdPerfilExamen }, perfilExamen));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Esempio n. 2
0
 public ActionResult <PerfilExamenDTO> Update(string id, [FromBody] PerfilExamenDTO perfilExamen)
 {
     try
     {
         if (perfilExamen == null)
         {
             return(NotFound());
         }
         _perfilExamenAppService.Update(perfilExamen);
         _perfilExamenAppService.Save();
         return(perfilExamen);
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }