Exemple #1
0
 public IActionResult Post([FromBody] Paciente entity)
 {
     if (entity == null)
     {
         return(BadRequest());
     }
     try
     {
         entity.DtInclusao = DateTime.Now;
         _service.AddOrUpdateAndCommitSync(entity);
         return(StatusCode(200, entity));
     }
     catch (Exception ex)
     {
         return(StatusCode(400, ex.Message.FirstOrDefault()));
     }
 }