public ActionResult Put([FromBody] UpdateAgendamentoDTO updateAgendamentoDTO) { try { _agendamentoService.Update(updateAgendamentoDTO); return(Ok()); } catch (Exception e) { string errors = e.Message; return(ValidationProblem(new ValidationProblemDetails() { Type = "Model Validation Error", Detail = errors })); } }
public IActionResult Put([FromBody] Agendamento novoAgendamento) { try { var agendamento = _agendamentoService.Update(novoAgendamento); if (agendamento == null) { return(NoContent()); } return(Created($"https://localhost:44399/api/agendamentos/{agendamento.Id}", agendamento)); } catch (System.Exception) { throw; } }
public async Task <ResultDto <bool> > Put(int id, [FromBody] AgendamentoDto agendamentoDto) { return(await _agendamentoService.Update(agendamentoDto)); }